Finished adding support for Oracle enums

This commit is contained in:
dvanaken 2019-12-10 23:04:24 +01:00 committed by Dana Van Aken
parent a3cc34ba8e
commit 65f3a7b0d6
6 changed files with 28 additions and 15 deletions

View File

@ -231,6 +231,14 @@ def set_field(fields):
fields['minval'] = None
fields['maxval'] = None
fields['default'] = True
fields['vartype'] = 4
if fields['name'].lower() == 'optimizer_features_enable':
fields['tunable'] = True
fields['minval'] = None
fields['maxval'] = None
fields['default'] = '12.2.0.1'
fields['vartype'] = 5
fields['enumvals'] = '11.2.0.1,11.2.0.2,11.2.0.3,11.2.0.4,12.1.0.1,12.1.0.2,12.2.0.1'
if fields['name'].upper() == 'DISK_ASYNCH_IO':
fields['tunable'] = True
fields['vartype'] = 5

View File

@ -20,3 +20,7 @@ class OracleParser(BaseParser):
(1024 ** 1, 'k'),
)
self.min_bytes_unit = 'k'
def format_enum(self, enum_value, metadata):
enum = super().format_enum(enum_value, metadata)
return "'{}'".format(enum)

View File

@ -5052,15 +5052,15 @@
"scope": "global",
"dbms": 121,
"category": "",
"enumvals": null,
"enumvals": "11.2.0.1,11.2.0.2,11.2.0.3,11.2.0.4,12.1.0.1,12.1.0.2,12.2.0.1",
"context": "",
"unit": 3,
"tunable": false,
"tunable": true,
"description": "",
"minval": null,
"maxval": null,
"vartype": 1,
"default": "?/rdbms/admin/sql.bsq",
"vartype": 5,
"default": "12.2.0.1",
"summary": "optimizer plan compatibility parameter"
}
},

View File

@ -5698,14 +5698,14 @@
"scope": "global",
"dbms": 12,
"category": "",
"enumvals": null,
"enumvals": "11.2.0.1,11.2.0.2,11.2.0.3,11.2.0.4,12.1.0.1,12.1.0.2,12.2.0.1",
"context": "",
"unit": 3,
"tunable": false,
"tunable": true,
"description": "",
"minval": null,
"maxval": null,
"vartype": 1,
"vartype": 5,
"default": "12.2.0.1",
"summary": "optimizer plan compatibility parameter"
}

View File

@ -6021,15 +6021,15 @@
"scope": "global",
"dbms": 19,
"category": "",
"enumvals": null,
"enumvals": "11.2.0.1,11.2.0.2,11.2.0.3,11.2.0.4,12.1.0.1,12.1.0.2,12.2.0.1",
"context": "",
"unit": 3,
"tunable": false,
"tunable": true,
"description": "",
"minval": null,
"maxval": null,
"vartype": 1,
"default": "19.1.0",
"vartype": 5,
"default": "12.2.0.1",
"summary": "optimizer plan compatibility parameter"
}
},

View File

@ -1130,14 +1130,15 @@ def train_ddpg_loops(request, session_id): # pylint: disable=unused-argument
@csrf_exempt
def alt_get_info(request, name):
def alt_get_info(request, name): # pylint: disable=unused-argument
# Backdoor method for getting basic info
if name == 'constants':
info = utils.get_constants()
return HttpResponse(JSONUtil.dumps(info))
response = HttpResponse(JSONUtil.dumps(info))
else:
LOG.warning("Invalid name for info request: %s", name)
return HttpResponse("Invalid name for info request: {}".format(name), status=400)
response = HttpResponse("Invalid name for info request: {}".format(name), status=400)
return response
@csrf_exempt
@ -1320,7 +1321,7 @@ def alt_create_or_edit_session(request):
upload_code=upload_code, creation_time=ts,
last_update=ts, **data)
except IntegrityError:
err_msg = "ERROR: Project '{}' already exists.".format(session_name)
err_msg = "ERROR: Session '{}' already exists.".format(session_name)
session = Session.objects.get(user=user, project=project, name=session_name)
response.update(error=err_msg, project=model_to_dict(session))
LOG.warning(err_msg)