| 1134 | @brief Remove "drop/create operator" statements in the sql script |
| 1135 | """ |
| 1136 | def _clean_operator(self): |
| 1137 | # remove 'drop operator' |
| 1138 | pattern = re.compile('DROP\s+OPERATOR.*?PROCEDURE\s+=.*?;', re.DOTALL | re.IGNORECASE) |
| 1139 | self._sql = re.sub(pattern, '', self._sql) |
| 1140 | |
| 1141 | # for create operator statements: |
| 1142 | # delete: unchanged, removed (not in the input sql anyway) |
| 1143 | # keep: new, changed |
| 1144 | for p in self._unchanged_operator_patterns: |
| 1145 | regex_pat = re.compile(p, re.DOTALL | re.IGNORECASE) |
| 1146 | self._sql = re.sub(regex_pat, '', self._sql) |
| 1147 | |
| 1148 | """ |
| 1149 | @brief Remove "drop/create operator class" statements in the sql script |