Why doesnøt "Show Tables" use the current schema instead of PUBLIC

46 views
Skip to first unread message

Jacob Qvortrup

unread,
May 15, 2012, 4:41:04 AM5/15/12
to h2-da...@googlegroups.com
Hi, i am wondering why the command "Show Tables" always uses the PUBLIC schema instead of the one set using the "Set Schema" command. The change would be very simple:

--- Parser.java (4146)
+++ Parser.java (working copy)
@@ -849,7 +850,7 @@
             buff.append("'UTF8' AS SERVER_ENCODING FROM DUAL");
         } else if (readIf("TABLES")) {
             // for MySQL compatibility
-            String schema = Constants.SCHEMA_MAIN;
+            String schema = session.getCurrentSchemaName();
             if (readIf("FROM")) {
                 schema = readUniqueIdentifier();
             }

Jacob Qvortrup

unread,
May 15, 2012, 8:10:00 AM5/15/12
to h2-da...@googlegroups.com
I went a little further and came up with another extension to the command SHOW TABLES.

1) The ability to tell how the column should be named.
2) A way to filter on table names.

Have a look and comment.

/Jacob
show_table.patch

Thomas Mueller

unread,
Nov 18, 2013, 4:13:33 AM11/18/13
to H2 Google Group
Hi,

Sorry for the (long) delay. Looking at the patch, I noticed:

> 1) The ability to tell how the column should be named.

I would like to avoid adding features that MySQL doesn't support. Could you remove this part? See also http://dev.mysql.com/doc/refman/5.7/en/show-tables.html

Also, could you also include a few test cases please? See also the checklist for patches at http://h2database.com/html/build.html#providing_patches

Regards,
Thomas




--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/mA3GOm_xEeEJ.

To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Reply all
Reply to author
Forward
0 new messages