mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix generation of reverse engineered SQL for Rules. Fixes #4586
This commit is contained in:
@@ -180,13 +180,15 @@ define('pgadmin.node.rule', [
|
||||
},
|
||||
{
|
||||
id: 'condition', label: gettext('Condition'),
|
||||
type: 'text', group: gettext('Definition'),
|
||||
control: Backform.SqlFieldControl,
|
||||
type: 'text', group: gettext('Condition'),
|
||||
tabPanelCodeClass: 'sql-code-control',
|
||||
control: Backform.SqlCodeControl,
|
||||
},
|
||||
{
|
||||
id: 'statements', label: gettext('Commands'),
|
||||
type: 'text', group: gettext('Definition'),
|
||||
control: Backform.SqlFieldControl,
|
||||
type: 'text', group: gettext('Commands'),
|
||||
tabPanelCodeClass: 'sql-code-control',
|
||||
control: Backform.SqlCodeControl,
|
||||
},
|
||||
{
|
||||
id: 'system_rule', label: gettext('System rule?'),
|
||||
|
||||
@@ -423,7 +423,7 @@ def parse_rule_definition(res):
|
||||
instead = True if instead_data is not None else False
|
||||
|
||||
# Parse data for condition
|
||||
condition_match = re.search(r"(?:WHERE)\s+(.*)\s+(?:DO)", data_def)
|
||||
condition_match = re.search(r"(?:WHERE)\s+([\s\S]*)\s+(?:DO)", data_def)
|
||||
condition_data = condition_match.group(1) \
|
||||
if condition_match is not None else None
|
||||
condition = condition_data if condition_data is not None else ''
|
||||
|
||||
Reference in New Issue
Block a user