# HG changeset patch # User catherine.devlin@gmail.com # Date 1310183488 14400 # Node ID 5c49b5a3268776d91401a760cc97588fafb9e770 # Parent 853b9e675dd77126d1ffc57531b132ac3cd58c2b MySQL table names are case sensitive diff -r 853b9e675dd7 -r 5c49b5a32687 sqlpython/connections.py --- a/sqlpython/connections.py Wed Jun 29 21:18:02 2011 -0400 +++ b/sqlpython/connections.py Fri Jul 08 23:51:28 2011 -0400 @@ -334,7 +334,7 @@ FROM information_schema.tables WHERE table_schema %(owner_op)s LOWER(%(owner)S) AND table_type %(type_op)s UPPER(%(type)S) - AND table_name %(name_op)s LOWER(%(name)S) + AND table_name %(name_op)s %(name)S ORDER BY table_schema, table_type, table_name %(sort_direction)s""" parameter_qry = """SHOW variables LIKE '%%%s%%'%s%s""" gerald_types = {'TABLE': gerald.mysql_schema.Table, diff -r 853b9e675dd7 -r 5c49b5a32687 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Wed Jun 29 21:18:02 2011 -0400 +++ b/sqlpython/sqlpyPlus.py Fri Jul 08 23:51:28 2011 -0400 @@ -1135,15 +1135,14 @@ def _do_dir(self, type, arg, opts): self._do_ls("%%/%s/%s%s%s" % (type, str(arg), arg.parsed.terminator, arg.parsed.suffix), opts) - + + table_type_name = {'postgres': 'base table', 'mysql': 'BASE TABLE', + 'oracle': 'TABLE' } @options(standard_options) def do__dir_tables(self, arg, opts): 'Shortcut for ``ls table/``' - if self.rdbms in ('postgres','mysql'): - target = 'base table' - else: - target = "table" - self._do_dir(target, arg, opts) + import pdb; pdb.set_trace() + self._do_dir(self.table_type_name[self.rdbms], arg, opts) @options(standard_options) def do__dir_views(self, arg, opts):