changeset 483:c5c1786cdee2

escape $ in names of schema objects sought
author Catherine Devlin <catherine.devlin@gmail.com>
date Wed, 25 Aug 2010 18:52:49 -0400
parents 8cf08822207b
children b7782506b5f3
files sqlpython/sqlpyPlus.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/sqlpyPlus.py	Thu Aug 05 07:06:48 2010 -0400
+++ b/sqlpython/sqlpyPlus.py	Wed Aug 25 18:52:49 2010 -0400
@@ -1568,6 +1568,7 @@
     def _regex_form_of_search_pattern(self, s, exact=False):
         if not s:
             return '^[^\.]*$'
+        s = s.replace('$','\$')  # not re.escape(s) b/c ``?`` is valid in SQL and regex
         if '.' in s:
             seekpatt = r'[/\\]?%s[/\\]?' % (
                 s.replace('*', '.*').replace('?','.').replace('%', '.*'))        
@@ -1593,8 +1594,6 @@
             self.pfeedback('Metadata is stale - requested refresh still underway')
                             
     def _matching_database_objects(self, arg, opts):
-        # doesn't get java$options
-
         (username, gerald_schema) = self.metadata()                
         self._print_gerald_status_warning(gerald_schema)
         if not gerald_schema.complete: