Creates a list of string patterns that represent all 'CREATE OPERATOR' statements not changed since the old version. @return unchanged = existing - changed
(self)
| 963 | 'argument': row['argument']}) |
| 964 | |
| 965 | def _get_unchanged_operator_patterns(self): |
| 966 | """ |
| 967 | Creates a list of string patterns that represent all |
| 968 | 'CREATE OPERATOR' statements not changed since the old version. |
| 969 | |
| 970 | @return unchanged = existing - changed |
| 971 | """ |
| 972 | self._get_existing_udo() # from the old version |
| 973 | operator_patterns = [] |
| 974 | # for all, pass the changed ones, add others to ret |
| 975 | for each_udo, udo_details in self._existing_udo.items(): |
| 976 | for each_item in udo_details: |
| 977 | if each_udo in self._ch.udo: |
| 978 | if each_item in self._ch.udo[each_udo]: |
| 979 | continue |
| 980 | p_arg_str = '' |
| 981 | # assuming binary ops |
| 982 | leftarg = self._rewrite_type_in(each_item['leftarg']) |
| 983 | rightarg = self._rewrite_type_in(each_item['rightarg']) |
| 984 | p_str = "CREATE\s+OPERATOR\s+{schema}\.{op_name}\s*\(" \ |
| 985 | "\s*leftarg\s*=\s*{leftarg}\s*," \ |
| 986 | "\s*rightarg\s*=\s*{rightarg}\s*," \ |
| 987 | ".*?\)\s*;".format(schema=self._schema.upper(), |
| 988 | op_name=re.escape(each_udo), **locals()) |
| 989 | operator_patterns.append(p_str) |
| 990 | return operator_patterns |
| 991 | |
| 992 | def _get_unchanged_opclass_patterns(self): |
| 993 | """ |
no test coverage detected