some indentantion errors introduced at https://github.com/kamailio/kamailio/commit/bc8bdcaa726f375f6deea8228a1ab0cf97c67035
related #1747
(cherry picked from commit b722a48144ac9e029bdbc2968dedbe56966a3f7c)
... | ... |
@@ -146,11 +146,11 @@ class DBText(object): |
146 | 146 |
# check if there is a function modifier on the columns |
147 | 147 |
if self.tokens[0] == 'COUNT': |
148 | 148 |
self.count = True |
149 |
- if col_end == 1: |
|
150 |
- raise ParseError('COUNT must be followed by column name[s]') |
|
151 |
- if not self.tokens[1].startswith(self._paren_placeholder): |
|
152 |
- raise ParseError('COUNT must be followed by ()') |
|
153 |
- cols_str = self._ReplaceParens(self.tokens[1]) |
|
149 |
+ if col_end == 1: |
|
150 |
+ raise ParseError('COUNT must be followed by column name[s]') |
|
151 |
+ if not self.tokens[1].startswith(self._paren_placeholder): |
|
152 |
+ raise ParseError('COUNT must be followed by ()') |
|
153 |
+ cols_str = self._ReplaceParens(self.tokens[1]) |
|
154 | 154 |
|
155 | 155 |
cols = cols_str.split(',') |
156 | 156 |
for col in cols: |
... | ... |
@@ -300,7 +300,7 @@ class DBText(object): |
300 | 300 |
if self.tokens.pop(0) != 'SET': |
301 | 301 |
raise ParseError('UPDATE command must be followed by SET') |
302 | 302 |
|
303 |
- self.targets = self._ParsePairs(' '.join(self.tokens), ',') |
|
303 |
+ self.targets = self._ParsePairs(' '.join(self.tokens), ',') |
|
304 | 304 |
|
305 | 305 |
# INSERT |
306 | 306 |
if self.command == 'INSERT': |
... | ... |
@@ -570,19 +570,19 @@ class DBText(object): |
570 | 570 |
string = '%s%s' % (string, c) |
571 | 571 |
continue # wait for matching delim |
572 | 572 |
|
573 |
- started -= 1 |
|
574 |
- if not started: |
|
575 |
- values.append(string) |
|
576 |
- new_args = '%s %s' % (new_args, '%s%d' % (placeholder, |
|
577 |
- my_id)) |
|
578 |
- my_id += 1 |
|
579 |
- string = '' |
|
573 |
+ started -= 1 |
|
574 |
+ if not started: |
|
575 |
+ values.append(string) |
|
576 |
+ new_args = '%s %s' % (new_args, '%s%d' % (placeholder, |
|
577 |
+ my_id)) |
|
578 |
+ my_id += 1 |
|
579 |
+ string = '' |
|
580 | 580 |
|
581 |
- else: |
|
582 |
- if not started: |
|
583 |
- new_args = '%s%s' % (new_args, c) |
|
584 | 581 |
else: |
585 |
- string = '%s%s' % (string, c) |
|
582 |
+ if not started: |
|
583 |
+ new_args = '%s%s' % (new_args, c) |
|
584 |
+ else: |
|
585 |
+ string = '%s%s' % (string, c) |
|
586 | 586 |
|
587 | 587 |
if started: |
588 | 588 |
if mode == 'parens': |
... | ... |
@@ -714,8 +714,8 @@ class DBText(object): |
714 | 714 |
elif self.header[col]['auto']: |
715 | 715 |
new_row[col] = self._GetNextAuto(col) |
716 | 716 |
|
717 |
- else: |
|
718 |
- raise ExecuteError(col + ' cannot be empty or null') |
|
717 |
+ else: |
|
718 |
+ raise ExecuteError(col + ' cannot be empty or null') |
|
719 | 719 |
|
720 | 720 |
self.data.append(new_row) |
721 | 721 |
return [1] |