|
|
@@ -1441,7 +1441,7 @@ $(document).ready(function () {
|
|
|
else {
|
|
|
CodeMirror.possibleTable = false;
|
|
|
CodeMirror.tableFieldMagic = false;
|
|
|
- if ((_before.toUpperCase().indexOf(" FROM ") > -1 || _before.toUpperCase().indexOf(" TABLE ") > -1 || _before.toUpperCase().indexOf(" STATS ") > -1) && _before.toUpperCase().indexOf(" ON ") == -1 && _before.toUpperCase().indexOf(" WHERE ") == -1 ||
|
|
|
+ if ((_before.toUpperCase().indexOf(" FROM ") > -1 || _before.toUpperCase().indexOf(" TABLE ") > -1 || _before.toUpperCase().indexOf(" STATS ") > -1) && _before.toUpperCase().indexOf(" ON ") == -1 && _before.toUpperCase().indexOf(" ORDER BY ") == -1 && _before.toUpperCase().indexOf(" WHERE ") == -1 ||
|
|
|
_before.toUpperCase().indexOf("REFRESH") > -1 || _before.toUpperCase().indexOf("METADATA") > -1 || _before.toUpperCase().indexOf("DESCRIBE") > -1) {
|
|
|
CodeMirror.possibleTable = true;
|
|
|
}
|
|
|
@@ -1456,7 +1456,7 @@ $(document).ready(function () {
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- if (_before.toUpperCase().indexOf("WHERE ") > -1 && !CodeMirror.fromDot && _before.toUpperCase().match(/ ON| LIMIT| GROUP| SORT/) == null) {
|
|
|
+ if ((_before.toUpperCase().indexOf("WHERE ") > -1 || _before.toUpperCase().indexOf("ORDER BY ") > -1) && !CodeMirror.fromDot && _before.toUpperCase().match(/ ON| LIMIT| GROUP| SORT/) == null) {
|
|
|
fieldsAutocomplete(cm);
|
|
|
}
|
|
|
else {
|
|
|
@@ -1474,7 +1474,7 @@ $(document).ready(function () {
|
|
|
var _value = getStatementAtCursor().statement;
|
|
|
var _from = _value.toUpperCase().indexOf("FROM");
|
|
|
if (_from > -1) {
|
|
|
- var _match = _value.toUpperCase().substring(_from).match(/ ON| LIMIT| WHERE| GROUP| SORT|;/);
|
|
|
+ var _match = _value.toUpperCase().substring(_from).match(/ ON| LIMIT| WHERE| GROUP| SORT| ORDER BY|;/);
|
|
|
var _to = _value.length;
|
|
|
if (_match) {
|
|
|
_to = _match.index;
|