1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <com/sun/star/sdbc/DataType.hpp>
22 #include <com/sun/star/sdbc/ColumnValue.hpp>
23 #include <com/sun/star/sdbc/ColumnSearch.hpp>
24 #include "mysqlc_types.hxx"
26 using namespace com::sun::star::sdbc
;
28 TypeInfoDef mysqlc_types
[] = {
30 // ------------- MySQL-Type: BIT. SDBC-Type: Bit -------------
33 com::sun::star::sdbc::DataType::BIT
, // sdbc-type
38 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
39 true, // case sensitive
40 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
42 false, // fixed_prec_scale
43 false, // auto_increment
44 "BIT", // local type name
49 // ------------ MySQL-Type: BOOL. SDBC-Type: Bit -------------
52 com::sun::star::sdbc::DataType::BIT
, // sdbc-type
57 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
58 true, // case sensitive
59 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
61 false, // fixed_prec_scale
62 false, // auto_increment
63 "BOOL", // local type name
68 // --------- MySQL-Type: TINYINT SDBC-Type: TINYINT ----------
70 "TINYINT", // Typename
71 com::sun::star::sdbc::DataType::TINYINT
, // sdbc-type
75 "[(M)] [UNSIGNED] [ZEROFILL]", // Create params
76 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
77 false, // case sensitive
78 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
80 false, // fixed_prec_scale
81 true, // auto_increment
82 "TINYINT", // local type name
87 // ----------- MySQL-Type: BIGINT SDBC-Type: BIGINT ----------
90 com::sun::star::sdbc::DataType::BIGINT
, // sdbc-type
94 "[(M)] [UNSIGNED] [ZEROFILL]", // Create params
95 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
96 false, // case sensitive
97 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
99 false, // fixed_prec_scale
100 true, // auto_increment
101 "BIGINT", // local type name
106 // ----------- MySQL-Type: LONG VARBINARY SDBC-Type: LONGVARBINARY ----------
108 "LONG VARBINARY", // Typename
109 com::sun::star::sdbc::DataType::LONGVARBINARY
, // sdbc-type
110 16777215, // Precision
111 "'", // Literal prefix
112 "'", // Literal suffix
114 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
115 true, // case sensitive
116 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
118 false, // fixed_prec_scale
119 false, // auto_increment
120 "LONG VARBINARY", // local type name
125 // ----------- MySQL-Type: MEDIUMBLOB SDBC-Type: LONGVARBINARY ----------
127 "MEDIUMBLOB", // Typename
128 com::sun::star::sdbc::DataType::LONGVARBINARY
, // sdbc-type
129 16777215, // Precision
130 "'", // Literal prefix
131 "'", // Literal suffix
133 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
134 true, // case sensitive
135 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
137 false, // fixed_prec_scale
138 false, // auto_increment
139 "MEDIUMBLOB", // local type name
144 // ----------- MySQL-Type: LONGBLOB SDBC-Type: LONGVARBINARY ----------
146 "LONGBLOB", // Typename
147 com::sun::star::sdbc::DataType::LONGVARBINARY
, // sdbc-type
149 "'", // Literal prefix
150 "'", // Literal suffix
152 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
153 true, // case sensitive
154 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
156 false, // fixed_prec_scale
157 false, // auto_increment
158 "LONGBLOB", // local type name
163 // ----------- MySQL-Type: BLOB SDBC-Type: LONGVARBINARY ----------
166 com::sun::star::sdbc::DataType::LONGVARBINARY
, // sdbc-type
168 "'", // Literal prefix
169 "'", // Literal suffix
171 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
172 true, // case sensitive
173 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
175 false, // fixed_prec_scale
176 false, // auto_increment
177 "BLOB", // local type name
182 // ----------- MySQL-Type: TINYBLOB SDBC-Type: LONGVARBINARY ----------
184 "TINYBLOB", // Typename
185 com::sun::star::sdbc::DataType::LONGVARBINARY
, // sdbc-type
187 "'", // Literal prefix
188 "'", // Literal suffix
190 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
191 true, // case sensitive
192 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
194 false, // fixed_prec_scale
195 false, // auto_increment
196 "TINYBLOB", // local type name
201 // ----------- MySQL-Type: VARBINARY SDBC-Type: VARBINARY ----------
203 "VARBINARY", // Typename
204 com::sun::star::sdbc::DataType::VARBINARY
, // sdbc-type
206 "'", // Literal prefix
207 "'", // Literal suffix
208 "(M)", // Create params
209 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
210 true, // case sensitive
211 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
213 false, // fixed_prec_scale
214 false, // auto_increment
215 "VARBINARY", // local type name
220 // ----------- MySQL-Type: BINARY SDBC-Type: BINARY ----------
222 "BINARY", // Typename
223 com::sun::star::sdbc::DataType::BINARY
, // sdbc-type
225 "'", // Literal prefix
226 "'", // Literal suffix
227 "(M)", // Create params
228 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
229 true, // case sensitive
230 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
232 false, // fixed_prec_scale
233 false, // auto_increment
234 "VARBINARY", // local type name
239 // ----------- MySQL-Type: LONG VARCHAR SDBC-Type: LONG VARCHAR ----------
241 "LONG VARCHAR", // Typename
242 com::sun::star::sdbc::DataType::LONGVARCHAR
, // sdbc-type
243 0xFFFFFF, // Precision
244 "'", // Literal prefix
245 "'", // Literal suffix
247 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
248 false, // case sensitive
249 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
251 false, // fixed_prec_scale
252 false, // auto_increment
253 "LONG VARCHAR", // local type name
258 // ----------- MySQL-Type: MEDIUMTEXT SDBC-Type: LONG VARCHAR ----------
260 "MEDIUMTEXT", // Typename
261 com::sun::star::sdbc::DataType::LONGVARCHAR
, // sdbc-type
262 0xFFFFFF, // Precision
263 "'", // Literal prefix
264 "'", // Literal suffix
266 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
267 false, // case sensitive
268 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
270 false, // fixed_prec_scale
271 false, // auto_increment
272 "MEDIUMTEXT", // local type name
277 // ----------- MySQL-Type: LONGTEXT SDBC-Type: LONG VARCHAR ----------
279 "LONGTEXT", // Typename
280 com::sun::star::sdbc::DataType::LONGVARCHAR
, // sdbc-type
281 0xFFFFFF, // Precision
282 "'", // Literal prefix
283 "'", // Literal suffix
285 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
286 false, // case sensitive
287 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
289 false, // fixed_prec_scale
290 false, // auto_increment
291 "LONGTEXT", // local type name
296 // ----------- MySQL-Type: TEXT SDBC-Type: LONG VARCHAR ----------
299 com::sun::star::sdbc::DataType::LONGVARCHAR
, // sdbc-type
301 "'", // Literal prefix
302 "'", // Literal suffix
304 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
305 false, // case sensitive
306 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
308 false, // fixed_prec_scale
309 false, // auto_increment
310 "TEXT", // local type name
315 // ----------- MySQL-Type: TINYTEXT SDBC-Type: LONG VARCHAR ----------
317 "TINYTEXT", // Typename
318 com::sun::star::sdbc::DataType::LONGVARCHAR
, // sdbc-type
320 "'", // Literal prefix
321 "'", // Literal suffix
323 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
324 false, // case sensitive
325 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
327 false, // fixed_prec_scale
328 false, // auto_increment
329 "TINYTEXT", // local type name
334 // ----------- MySQL-Type: CHAR SDBC-Type: CHAR ----------
337 com::sun::star::sdbc::DataType::CHAR
, // sdbc-type
339 "'", // Literal prefix
340 "'", // Literal suffix
341 "(M)", // Create params
342 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
343 false, // case sensitive
344 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
346 false, // fixed_prec_scale
347 false, // auto_increment
348 "NUMERIC", // local type name
353 // ----------- MySQL-Type: DECIMAL SDBC-Type: DECIMAL ----------
355 "DECIMAL", // Typename
356 com::sun::star::sdbc::DataType::DECIMAL
, // sdbc-type
358 "", // Literal prefix
359 "", // Literal suffix
360 "[(M[,D])] [ZEROFILL]", // Create params
361 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
362 false, // case sensitive
363 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
365 false, // fixed_prec_scale
366 true, // auto_increment
367 "DECIMAL", // local type name
368 -308, // minimum scale
372 // ----------- MySQL-Type: NUMERIC SDBC-Type: NUMERIC ----------
374 "NUMERIC", // Typename
375 com::sun::star::sdbc::DataType::NUMERIC
, // sdbc-type
377 "", // Literal prefix
378 "", // Literal suffix
379 "[(M[,D])] [ZEROFILL]", // Create params
380 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
381 false, // case sensitive
382 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
384 false, // fixed_prec_scale
385 true, // auto_increment
386 "NUMERIC", // local type name
387 -308, // minimum scale
391 // ----------- MySQL-Type: INTEGER SDBC-Type: INTEGER ----------
393 "INTEGER", // Typename
394 com::sun::star::sdbc::DataType::INTEGER
, // sdbc-type
396 "", // Literal prefix
397 "", // Literal suffix
398 "[(M)] [UNSIGNED] [ZEROFILL]", // Create params
399 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
400 false, // case sensitive
401 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
403 false, // fixed_prec_scale
404 true, // auto_increment
405 "INTEGER", // local type name
410 // ----------- MySQL-Type: INT SDBC-Type: INTEGER ----------
413 com::sun::star::sdbc::DataType::INTEGER
, // sdbc-type
415 "", // Literal prefix
416 "", // Literal suffix
417 "[(M)] [UNSIGNED] [ZEROFILL]", // Create params
418 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
419 false, // case sensitive
420 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
422 false, // fixed_prec_scale
423 true, // auto_increment
424 "INT", // local type name
429 // ----------- MySQL-Type: MEDIUMINT SDBC-Type: INTEGER ----------
431 "MEDIUMINT", // Typename
432 com::sun::star::sdbc::DataType::INTEGER
, // sdbc-type
434 "", // Literal prefix
435 "", // Literal suffix
436 "[(M)] [UNSIGNED] [ZEROFILL]", // Create params
437 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
438 false, // case sensitive
439 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
441 false, // fixed_prec_scale
442 true, // auto_increment
443 "MEDIUMINT", // local type name
448 // ----------- MySQL-Type: SMALLINT SDBC-Type: INTEGER ----------
450 "SMALLINT", // Typename
451 com::sun::star::sdbc::DataType::SMALLINT
, // sdbc-type
453 "", // Literal prefix
454 "", // Literal suffix
455 "[(M)] [UNSIGNED] [ZEROFILL]", // Create params
456 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
457 false, // case sensitive
458 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
460 false, // fixed_prec_scale
461 true, // auto_increment
462 "SMALLINT", // local type name
467 // ----------- MySQL-Type: FLOAT SDBC-Type: REAL ----------
470 com::sun::star::sdbc::DataType::REAL
, // sdbc-type
472 "", // Literal prefix
473 "", // Literal suffix
474 "[(M,D)] [ZEROFILL]", // Create params
475 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
476 false, // case sensitive
477 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
479 false, // fixed_prec_scale
480 true, // auto_increment
481 "FLOAT", // local type name
482 -38, // minimum scale
486 // ----------- MySQL-Type: DOUBLE SDBC-Type: DOUBLE ----------
488 "DOUBLE", // Typename
489 com::sun::star::sdbc::DataType::DOUBLE
, // sdbc-type
491 "", // Literal prefix
492 "", // Literal suffix
493 "[(M,D)] [ZEROFILL]", // Create params
494 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
495 false, // case sensitive
496 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
498 false, // fixed_prec_scale
499 true, // auto_increment
500 "DOUBLE", // local type name
501 -308, // minimum scale
505 // ----------- MySQL-Type: DOUBLE PRECISION SDBC-Type: DOUBLE ----------
507 "DOUBLE PRECISION", // Typename
508 com::sun::star::sdbc::DataType::DOUBLE
, // sdbc-type
510 "", // Literal prefix
511 "", // Literal suffix
512 "[(M,D)] [ZEROFILL]", // Create params
513 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
514 false, // case sensitive
515 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
517 false, // fixed_prec_scale
518 true, // auto_increment
519 "DOUBLE PRECISION", // local type name
520 -308, // minimum scale
524 // ----------- MySQL-Type: REAL SDBC-Type: DOUBLE ----------
527 com::sun::star::sdbc::DataType::DOUBLE
, // sdbc-type
529 "", // Literal prefix
530 "", // Literal suffix
531 "[(M,D)] [ZEROFILL]", // Create params
532 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
533 false, // case sensitive
534 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
536 false, // fixed_prec_scale
537 true, // auto_increment
538 "REAL", // local type name
539 -308, // minimum scale
543 // ----------- MySQL-Type: VARCHAR SDBC-Type: VARCHAR ----------
545 "VARCHAR", // Typename
546 com::sun::star::sdbc::DataType::VARCHAR
, // sdbc-type
548 "'", // Literal prefix
549 "'", // Literal suffix
550 "(M)", // Create params
551 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
552 false, // case sensitive
553 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
555 false, // fixed_prec_scale
556 false, // auto_increment
557 "VARCHAR", // local type name
562 // ----------- MySQL-Type: ENUM SDBC-Type: VARCHAR ----------
565 com::sun::star::sdbc::DataType::VARCHAR
, // sdbc-type
567 "'", // Literal prefix
568 "'", // Literal suffix
570 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
571 false, // case sensitive
572 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
574 false, // fixed_prec_scale
575 false, // auto_increment
576 "ENUM", // local type name
581 // ----------- MySQL-Type: SET SDBC-Type: VARCHAR ----------
584 com::sun::star::sdbc::DataType::VARCHAR
, // sdbc-type
586 "'", // Literal prefix
587 "'", // Literal suffix
589 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
590 false, // case sensitive
591 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
593 false, // fixed_prec_scale
594 false, // auto_increment
595 "SET", // local type name
600 // ----------- MySQL-Type: DATE SDBC-Type: DATE ----------
603 com::sun::star::sdbc::DataType::DATE
, // sdbc-type
605 "'", // Literal prefix
606 "'", // Literal suffix
608 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
609 false, // case sensitive
610 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
612 false, // fixed_prec_scale
613 false, // auto_increment
614 "DATE", // local type name
619 // ----------- MySQL-Type: TIME SDBC-Type: TIME ----------
622 com::sun::star::sdbc::DataType::TIME
, // sdbc-type
624 "'", // Literal prefix
625 "'", // Literal suffix
627 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
628 false, // case sensitive
629 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
631 false, // fixed_prec_scale
632 false, // auto_increment
633 "TIME", // local type name
638 // ----------- MySQL-Type: DATETIME SDBC-Type: TIMESTAMP ----------
640 "DATETIME", // Typename
641 com::sun::star::sdbc::DataType::TIMESTAMP
, // sdbc-type
643 "'", // Literal prefix
644 "'", // Literal suffix
646 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
647 false, // case sensitive
648 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
650 false, // fixed_prec_scale
651 false, // auto_increment
652 "DATETIME", // local type name
657 // ----------- MySQL-Type: TIMESTAMP SDBC-Type: TIMESTAMP ----------
659 "TIMESTAMP", // Typename
660 com::sun::star::sdbc::DataType::TIMESTAMP
, // sdbc-type
662 "'", // Literal prefix
663 "'", // Literal suffix
664 "[(M)]", // Create params
665 com::sun::star::sdbc::ColumnValue::NULLABLE
, // nullable
666 false, // case sensitive
667 com::sun::star::sdbc::ColumnSearch::FULL
, // searchable
669 false, // fixed_prec_scale
670 false, // auto_increment
671 "TIMESTAMP", // local type name
676 // ----------- MySQL-Type: TIMESTAMP SDBC-Type: TIMESTAMP ----------
678 nullptr, 0, 0, nullptr, nullptr, nullptr, 0, false, 0, false, false, false, nullptr, 0, 0
682 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */