|
31 | 31 |
|
32 | 32 | public class DatabaseMetaDataImpl implements java.sql.DatabaseMetaData, JdbcV2Wrapper { |
33 | 33 | private static final Logger log = LoggerFactory.getLogger(DatabaseMetaDataImpl.class); |
| 34 | + |
| 35 | + public enum TableType { |
| 36 | + DICTIONARY("DICTIONARY"), |
| 37 | + LOG_TABLE("LOG TABLE"), |
| 38 | + MEMORY_TABLE("MEMORY TABLE"), |
| 39 | + REMOTE_TABLE("REMOTE TABLE"), |
| 40 | + TABLE("TABLE"), |
| 41 | + VIEW("VIEW"), |
| 42 | + SYSTEM_TABLE("SYSTEM TABLE"), |
| 43 | + TEMPORARY_TABLE("TEMPORARY TABLE"); |
| 44 | + |
| 45 | + private final String typeName; |
| 46 | + |
| 47 | + TableType(String typeName) { |
| 48 | + this.typeName = typeName; |
| 49 | + } |
| 50 | + |
| 51 | + public String getTypeName() { |
| 52 | + return typeName; |
| 53 | + } |
| 54 | + } |
34 | 55 | public static final String[] TABLE_TYPES = new String[] { "DICTIONARY", "LOG TABLE", "MEMORY TABLE", |
35 | 56 | "REMOTE TABLE", "TABLE", "VIEW", "SYSTEM TABLE", "TEMPORARY TABLE" }; |
36 | 57 |
|
@@ -544,107 +565,107 @@ public boolean supportsOpenStatementsAcrossRollback() throws SQLException { |
544 | 565 |
|
545 | 566 | @Override |
546 | 567 | public int getMaxBinaryLiteralLength() throws SQLException { |
547 | | - return 0; |
| 568 | + return Integer.MAX_VALUE; |
548 | 569 | } |
549 | 570 |
|
550 | 571 | @Override |
551 | 572 | public int getMaxCharLiteralLength() throws SQLException { |
552 | | - return 0; |
| 573 | + return Integer.MAX_VALUE; |
553 | 574 | } |
554 | 575 |
|
555 | 576 | @Override |
556 | 577 | public int getMaxColumnNameLength() throws SQLException { |
557 | | - return 0; |
| 578 | + return Short.MAX_VALUE; |
558 | 579 | } |
559 | 580 |
|
560 | 581 | @Override |
561 | 582 | public int getMaxColumnsInGroupBy() throws SQLException { |
562 | | - return 0; |
| 583 | + return 0; // no limit |
563 | 584 | } |
564 | 585 |
|
565 | 586 | @Override |
566 | 587 | public int getMaxColumnsInIndex() throws SQLException { |
567 | | - return 0; |
| 588 | + return 0; // no limit |
568 | 589 | } |
569 | 590 |
|
570 | 591 | @Override |
571 | 592 | public int getMaxColumnsInOrderBy() throws SQLException { |
572 | | - return 0; |
| 593 | + return 0; // no limit |
573 | 594 | } |
574 | 595 |
|
575 | 596 | @Override |
576 | 597 | public int getMaxColumnsInSelect() throws SQLException { |
577 | | - return 0; |
| 598 | + return 0; // no limit |
578 | 599 | } |
579 | 600 |
|
580 | 601 | @Override |
581 | 602 | public int getMaxColumnsInTable() throws SQLException { |
582 | | - return 0; |
| 603 | + return 1000; |
583 | 604 | } |
584 | 605 |
|
585 | 606 | @Override |
586 | 607 | public int getMaxConnections() throws SQLException { |
587 | | - return 0; |
| 608 | + return 150; // no limit in theory but 150 is too many from one client |
588 | 609 | } |
589 | 610 |
|
590 | 611 | @Override |
591 | 612 | public int getMaxCursorNameLength() throws SQLException { |
592 | | - return 0; |
| 613 | + return 0; // no cursor - no limit |
593 | 614 | } |
594 | 615 |
|
595 | 616 | @Override |
596 | 617 | public int getMaxIndexLength() throws SQLException { |
597 | | - return 0; |
| 618 | + return 0; // no limit |
598 | 619 | } |
599 | 620 |
|
600 | 621 | @Override |
601 | 622 | public int getMaxSchemaNameLength() throws SQLException { |
602 | | - return 0; |
| 623 | + return Integer.MAX_VALUE; |
603 | 624 | } |
604 | 625 |
|
605 | 626 | @Override |
606 | 627 | public int getMaxProcedureNameLength() throws SQLException { |
607 | | - return 0; |
| 628 | + return 0; // no limit |
608 | 629 | } |
609 | 630 |
|
610 | 631 | @Override |
611 | 632 | public int getMaxCatalogNameLength() throws SQLException { |
612 | | - return 0; |
| 633 | + return 0; // no catalog - no limit |
613 | 634 | } |
614 | 635 |
|
615 | 636 | @Override |
616 | 637 | public int getMaxRowSize() throws SQLException { |
617 | | - return 0; |
| 638 | + return 0; // no limit |
618 | 639 | } |
619 | 640 |
|
620 | 641 | @Override |
621 | 642 | public boolean doesMaxRowSizeIncludeBlobs() throws SQLException { |
622 | | - return true; |
| 643 | + return true; // blobs sent as String as part of row data and not accessible from somehow else |
623 | 644 | } |
624 | 645 |
|
625 | 646 | @Override |
626 | 647 | public int getMaxStatementLength() throws SQLException { |
627 | | - return 0; |
| 648 | + return 0; // there is configurable limit in ClickHouse but at this point we treat it as unknown. |
628 | 649 | } |
629 | 650 |
|
630 | 651 | @Override |
631 | 652 | public int getMaxStatements() throws SQLException { |
632 | | - return 0; |
| 653 | + return getMaxConnections(); // as much as connections |
633 | 654 | } |
634 | 655 |
|
635 | 656 | @Override |
636 | 657 | public int getMaxTableNameLength() throws SQLException { |
637 | | - return 0; |
| 658 | + return Integer.MAX_VALUE; |
638 | 659 | } |
639 | 660 |
|
640 | 661 | @Override |
641 | 662 | public int getMaxTablesInSelect() throws SQLException { |
642 | | - return 0; |
| 663 | + return 0; // no limit |
643 | 664 | } |
644 | 665 |
|
645 | 666 | @Override |
646 | 667 | public int getMaxUserNameLength() throws SQLException { |
647 | | - return 0; |
| 668 | + return 0; // unknown |
648 | 669 | } |
649 | 670 |
|
650 | 671 | @Override |
@@ -1541,7 +1562,7 @@ public boolean generatedKeyAlwaysReturned() throws SQLException { |
1541 | 1562 |
|
1542 | 1563 | @Override |
1543 | 1564 | public long getMaxLogicalLobSize() throws SQLException { |
1544 | | - return 0; |
| 1565 | + return 0; // no limits - mainly stored as strings |
1545 | 1566 | } |
1546 | 1567 |
|
1547 | 1568 | @Override |
|
0 commit comments