equal
deleted
inserted
replaced
1178 return '' |
1178 return '' |
1179 |
1179 |
1180 def _temp_table_scope(self, select, table): |
1180 def _temp_table_scope(self, select, table): |
1181 scope = 9999 |
1181 scope = 9999 |
1182 for var, sql in self._varmap.iteritems(): |
1182 for var, sql in self._varmap.iteritems(): |
1183 if table == sql.split('.', 1)[0]: |
1183 # skip "attribute variable" in varmap (such 'T.login') |
|
1184 if not '.' in var and table == sql.split('.', 1)[0]: |
1184 try: |
1185 try: |
1185 scope = min(scope, self._state.scopes[select.defined_vars[var].scope]) |
1186 scope = min(scope, self._state.scopes[select.defined_vars[var].scope]) |
1186 except KeyError: |
1187 except KeyError: |
1187 scope = 0 # XXX |
1188 scope = 0 # XXX |
1188 if scope == 0: |
1189 if scope == 0: |
1189 return 0 |
1190 break |
1190 return 0 |
1191 return scope |
1191 |
1192 |
1192 def _var_info(self, var): |
1193 def _var_info(self, var): |
1193 try: |
1194 try: |
1194 sql = self._varmap[var.name] |
1195 sql = self._varmap[var.name] |
1195 tablealias = sql.split('.', 1)[0] |
1196 tablealias = sql.split('.', 1)[0] |