diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-06-17 12:43:00 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-06-17 12:43:00 +0000 |
commit | 5363acf332619a5fc823ff126363a0b030373f35 (patch) | |
tree | b79ee7714d9bffd9ba7091370669358ecf8dbdcf /Source/CustomQuery.m | |
parent | e049666c01af4e7c25ea6b2026935dfa65fd3321 (diff) | |
download | sequelpro-5363acf332619a5fc823ff126363a0b030373f35.tar.gz sequelpro-5363acf332619a5fc823ff126363a0b030373f35.tar.bz2 sequelpro-5363acf332619a5fc823ff126363a0b030373f35.zip |
• changed regex of trigger a reload of table/db according to executed queries
- now it also recognizes such keywords with leading comments
- still further improvements are needed
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r-- | Source/CustomQuery.m | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 26888225..495f6b20 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -473,10 +473,11 @@ [errors setString:[mySQLConnection getLastErrorMessage]]; } } else { - // Check if table list needs an update - if(!tableListNeedsReload && [[queries objectAtIndex:i] isMatchedByRegex:@"(?i)^\\s*(create|alter|drop|rename)\\s"]) + // Check if table/db list needs an update + // The regex is a compromise between speed and usefullness. TODO: further improvements are needed + if(!tableListNeedsReload && [[queries objectAtIndex:i] isMatchedByRegex:@"(?i)\\b(create|alter|drop|rename)\\b\\s+."]) tableListNeedsReload = YES; - if(!databaseWasChanged && [[queries objectAtIndex:i] isMatchedByRegex:@"(?i)^\\s*(use|drop\\s+database|drop\\s+schema)\\s"]) + if(!databaseWasChanged && [[queries objectAtIndex:i] isMatchedByRegex:@"(?i)\\b(use|drop\\s+database|drop\\s+schema)\\b\\s+."]) databaseWasChanged = YES; } } |