&& offset >= 2 && (query[offset - 1] == 'e' || query[offset - 1] == 'E') && charTerminatesIdentifier(query[offset - 2])) { standardConformingStrings = false;
&& (offset == 0 || !isIdentifierContChar(query[offset - 1]))) { int endIdx = -1; if (query[offset + 1] == '$') { endIdx = offset + 1; } else if (isDollarQuoteStartChar(query[offset + 1])) { for (int d = offset + 2; d < query.length; ++d) { if (query[d] == '$') { endIdx = d; break; } else if (!isDollarQuoteContChar(query[d])) { break; && subArraysEqual(query, tagIdx, offset, tagLen)) { offset += tagLen - 1; break;
/** * @param c character * @return true if the character terminates an identifier */ public static boolean charTerminatesIdentifier(char c) { return c == '"' || isSpace(c) || isOperatorChar(c); }
if (wordLength == 6 && parseUpdateKeyword(aChars, keywordStart)) { command = SqlCommandType.UPDATE; } else if (wordLength == 6 && parseDeleteKeyword(aChars, keywordStart)) { command = SqlCommandType.DELETE; } else if (wordLength == 6 && parseInsertKeyword(aChars, keywordStart)) { command = SqlCommandType.INSERT; } else if (wordLength == 6 && parseSelectKeyword(aChars, keywordStart)) { command = SqlCommandType.SELECT; } else { char nextChar = aChars[nextInd]; if (nextChar == '-') { nextInd = Parser.parseLineComment(aChars, nextInd); } else if (nextChar == '/') { nextInd = Parser.parseBlockComment(aChars, nextInd); } else if (Character.isWhitespace(nextChar)) { || (!parseAsKeyword(aChars, nextInd) || isIdentifierContChar(aChars[nextInd + 2]))) { return command;
i = Parser.parseSingleQuotes(aChars, i, stdStrings); break; i = Parser.parseDoubleQuotes(aChars, i); break; i = Parser.parseLineComment(aChars, i); break; i = Parser.parseBlockComment(aChars, i); break; i = Parser.parseDollarQuotes(aChars, i); break;
i = Parser.parseSingleQuotes(aChars, i, standardConformingStrings); break; i = Parser.parseDoubleQuotes(aChars, i); break; i = Parser.parseLineComment(aChars, i); break; i = Parser.parseBlockComment(aChars, i); break; i = Parser.parseDollarQuotes(aChars, i); break; if (addReturning(nativeSql, currentCommandType, returningColumnNames, isReturningPresent)) { isReturningPresent = true; toIntArray(bindPositions), false, SqlCommand.createStatementTypeInfo( currentCommandType, isBatchedReWriteConfigured, valuesBraceOpenPosition, isKeyWordChar = isIdentifierContChar(aChar); break; isKeyWordChar = isIdentifierStartChar(aChar); if (isKeyWordChar) { keywordStart = i;
if (c == '$') { int i0 = i; i = parseDollarQuotes(p_sql, i); checkParsePosition(i, len, i0, p_sql, "Unterminated dollar quote started at position {0} in SQL {1}. Expected terminating $$"); newsql.append(p_sql, i0, i - i0 + 1); i = parseSingleQuotes(p_sql, i, stdStrings); checkParsePosition(i, len, i0, p_sql, "Unterminated string literal started at position {0} in SQL {1}. Expected ' char"); newsql.append(p_sql, i0, i - i0 + 1); i = parseDoubleQuotes(p_sql, i); checkParsePosition(i, len, i0, p_sql, "Unterminated identifier started at position {0} in SQL {1}. Expected \" char"); newsql.append(p_sql, i0, i - i0 + 1); } else if (c == '/') { int i0 = i; i = parseBlockComment(p_sql, i); checkParsePosition(i, len, i0, p_sql, "Unterminated block comment started at position {0} in SQL {1}. Expected */ sequence"); newsql.append(p_sql, i0, i - i0 + 1); } else if (c == '-') { int i0 = i; i = parseLineComment(p_sql, i); newsql.append(p_sql, i0, i - i0 + 1); break;
/** * Checks if a character is valid as the second or later character of a dollar quoting tag. * * @param c the character to check * @return true if valid as second or later character of a dollar quoting tag; false if not */ public static boolean isDollarQuoteContChar(char c) { return c != '$' && isIdentifierContChar(c); }
i = Parser.parseSingleQuotes(aChars, i, standardConformingStrings); break; i = Parser.parseDoubleQuotes(aChars, i); break; i = Parser.parseLineComment(aChars, i); break; i = Parser.parseBlockComment(aChars, i); break; i = Parser.parseDollarQuotes(aChars, i); break;
i = Parser.parseSingleQuotes(aChars, i, stdStrings); break; i = Parser.parseDoubleQuotes(aChars, i); break; i = Parser.parseLineComment(aChars, i); break; i = Parser.parseBlockComment(aChars, i); break; i = Parser.parseDollarQuotes(aChars, i); break;
&& (offset == 0 || !isIdentifierContChar(query[offset-1]))) else if (isDollarQuoteStartChar(query[offset + 1])) break; else if (!isDollarQuoteContChar(query[d])) break; subArraysEqual(query, tagIdx, offset, tagLen))
/** * @return true if the character terminates an identifier */ public static boolean charTerminatesIdentifier(char c) { return c == '"' || isSpace(c) || isOperatorChar(c); }
&& offset >= 2 && (query[offset-1] == 'e' || query[offset-1] == 'E') && charTerminatesIdentifier(query[offset-2]))
i = Parser.parseSingleQuotes(aChars, i, stdStrings); break; i = Parser.parseDoubleQuotes(aChars, i); break; i = Parser.parseLineComment(aChars, i); break; i = Parser.parseBlockComment(aChars, i); break; i = Parser.parseDollarQuotes(aChars, i); break;
&& (offset == 0 || !isIdentifierContChar(query[offset-1]))) else if (isDollarQuoteStartChar(query[offset + 1])) break; else if (!isDollarQuoteContChar(query[d])) break; subArraysEqual(query, tagIdx, offset, tagLen))
/** * @return true if the character terminates an identifier */ public static boolean charTerminatesIdentifier(char c) { return c == '"' || isSpace(c) || isOperatorChar(c); }
&& offset >= 2 && (query[offset-1] == 'e' || query[offset-1] == 'E') && charTerminatesIdentifier(query[offset-2]))
i = Parser.parseSingleQuotes(aChars, i, standardConformingStrings); break; i = Parser.parseDoubleQuotes(aChars, i); break; i = Parser.parseLineComment(aChars, i); break; i = Parser.parseBlockComment(aChars, i); break; i = Parser.parseDollarQuotes(aChars, i); break;
&& (offset == 0 || !isIdentifierContChar(query[offset-1]))) else if (isDollarQuoteStartChar(query[offset + 1])) break; else if (!isDollarQuoteContChar(query[d])) break; subArraysEqual(query, tagIdx, offset, tagLen))
/** * @return true if the character terminates an identifier */ public static boolean charTerminatesIdentifier(char c) { return c == '"' || isSpace(c) || isOperatorChar(c); }