Răsfoiți Sursa

HUE-6491 [autocomplete] Prevent logging of unknown chars to the console

Johan Ahlen 8 ani în urmă
părinte
comite
26c89c58f1

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/aceSqlWorker.js

@@ -14,7 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-var version = 18;
+var version = 19;
 importScripts('/static/desktop/js/autocomplete/sqlParseSupport.js?version=' + version);
 importScripts('/static/desktop/js/autocomplete/sql.js?version=' + version);
 importScripts('/static/desktop/js/sqlFunctions.js?version=' + version);

+ 7 - 0
desktop/core/src/desktop/static/desktop/js/autocomplete/jison/sql.jisonlex

@@ -494,3 +494,10 @@ ROW_NUMBER\s*\(                            { yy.lexer.unput('('); yytext = 'row_
 <<EOF>>                                    { return 'EOF'; }
 
 .                                          { /* To prevent console logging of unknown chars */ }
+<between>.                                 { }
+<hive>.                                    { }
+<impala>.                                  { }
+<hdfs>.                                    { }
+<backtickedValue>.                         { }
+<singleQuotedValue>.                       { }
+<doubleQuotedValue>.                       { }

+ 2 - 0
desktop/core/src/desktop/static/desktop/js/autocomplete/jison/sqlStatementsParser.jison

@@ -25,6 +25,8 @@
 <<EOF>>                                                               { return 'EOF'; }
 ([^;"'`]|(["][^"]*["])|(['][^']*['])|([`][^`]*[`]))*[;]?              { return 'STATEMENT'; }
 
+.                                                                     { /* skip unknown chars */ }
+
 /lex
 
 %start SqlStatementsParser

Fișier diff suprimat deoarece este prea mare
+ 15 - 1
desktop/core/src/desktop/static/desktop/js/autocomplete/sql.js


+ 5 - 3
desktop/core/src/desktop/static/desktop/js/autocomplete/sqlStatementsParser.js

@@ -607,12 +607,14 @@ case 3: return 5;
 break;
 case 4: return 6; 
 break;
-case 5:console.log(yy_.yytext);
+case 5: /* skip unknown chars */ 
+break;
+case 6:console.log(yy_.yytext);
 break;
 }
 },
-rules: [/^(?:\s)/,/^(?:--.*)/,/^(?:[\/][*][^*]*[*]+([^\/*][^*]*[*]+)*[\/])/,/^(?:$)/,/^(?:([^;"'`]|(["][^"]*["])|(['][^']*['])|([`][^`]*[`]))*[;]?)/,/^(?:.)/],
-conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}}
+rules: [/^(?:\s)/,/^(?:--.*)/,/^(?:[\/][*][^*]*[*]+([^\/*][^*]*[*]+)*[\/])/,/^(?:$)/,/^(?:([^;"'`]|(["][^"]*["])|(['][^']*['])|([`][^`]*[`]))*[;]?)/,/^(?:.)/,/^(?:.)/],
+conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6],"inclusive":true}}
 });
 return lexer;
 })();

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff