com.huawei.opengauss.jdbc.core.Parser.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opengaussjdbc Show documentation
Show all versions of opengaussjdbc Show documentation
HuaweiCloud JDBC for GaussDB
The newest version!
???? 4 %com/huawei/opengauss/jdbc/core/Parser java/lang/Object Parser.java 'com/huawei/opengauss/jdbc/core/Parser$1 3com/huawei/opengauss/jdbc/core/Parser$SqlParseState
SqlParseState NO_BINDS [I chars [C QUOTE_OR_ALPHABETIC_MARKER )QUOTE_OR_ALPHABETIC_MARKER_OR_PARENTHESIS SINGLE_QUOTE ()V
this 'Lcom/huawei/opengauss/jdbc/core/Parser; parseJdbcSql ;(Ljava/lang/String;ZZZZ[Ljava/lang/String;)Ljava/util/List; java/sql/SQLException <(Ljava/lang/String;ZZZZZ[Ljava/lang/String;)Ljava/util/List;
query Ljava/lang/String; standardConformingStrings Z withParameters splitStatements isBatchedReWriteConfigured returningColumnNames [Ljava/lang/String; startWithComment (Ljava/lang/String;)Z ( )
* removeFirstComment &(Ljava/lang/String;)Ljava/lang/String; , -
. \s+ 0 java/lang/String 2 trim ()Ljava/lang/String; 4 5
3 6 ?? 8
replaceAll 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; : ;
3 < split '(Ljava/lang/String;)[Ljava/lang/String; > ?
3 @ isContainSpecKeyword ([Ljava/lang/String;)Z B C
D *com/huawei/opengauss/jdbc/core/NativeQuery F -com/huawei/opengauss/jdbc/core/SqlCommandType H BLANK /Lcom/huawei/opengauss/jdbc/core/SqlCommandType; J K I L )com/huawei/opengauss/jdbc/core/SqlCommand N createStatementTypeInfo \(Lcom/huawei/opengauss/jdbc/core/SqlCommandType;)Lcom/huawei/opengauss/jdbc/core/SqlCommand; P Q
O R @(Ljava/lang/String;Lcom/huawei/opengauss/jdbc/core/SqlCommand;)V T
G U java/util/Collections W
singletonList $(Ljava/lang/Object;)Ljava/util/List; Y Z
X [ '??? toCharArray ()[C _ `
3 a java/lang/StringBuilder c length ()I e f
3 g (I)V i
d j java/util/List m java/lang/Character o isWhitespace (C)Z q r
p s parseSingleQuotes ([CIZ)I u v
w parseDoubleQuotes ([CI)I y z
{ parseLineComment } z
~ parseBlockComment ? z
? * ? valueOf (C)Ljava/lang/String; ? ?
3 ? equals (Ljava/lang/Object;)Z ? ?
3 ?
? ? append ([CII)Ljava/lang/StringBuilder; ? ?
d ?
d g addReturning _(Ljava/lang/StringBuilder;Lcom/huawei/opengauss/jdbc/core/SqlCommandType;[Ljava/lang/String;Z)Z ? ?
? java/util/ArrayList ?
? size ? f n ? get (I)Ljava/lang/Object; ? ? n ? java/lang/Integer ? intValue ? f
? ? toString ? 5
d ?
toIntArray (Ljava/util/List;)[I ? ?
? a(Lcom/huawei/opengauss/jdbc/core/SqlCommandType;ZIIZI)Lcom/huawei/opengauss/jdbc/core/SqlCommand; P ?
O ? C(Ljava/lang/String;[IZLcom/huawei/opengauss/jdbc/core/SqlCommand;)V ?
G ? add ? ? n ? clear ? n ? setLength ? i
d ? parseDollarQuotes ? z
? (C)Ljava/lang/StringBuilder; ? ?
d ? (I)Ljava/lang/Integer; ? ?
? ? bindName (I)Ljava/lang/String; ? ?
G ? -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
d ? ([CII)V ?
3 ? java/util/Locale ? ENGLISH Ljava/util/Locale; ? ? ? ? toUpperCase &(Ljava/util/Locale;)Ljava/lang/String; ? ?
3 ? isFuncEnd ? )
? isSpace ? r
? E ? equalsIgnoreCase ? )
3 ? N ? D ? G ? I ? isSpecialCharacters ? r
? ; ? parseEnd (I[CI)[I ? ?
? isIdentifierContChar ? r
? isIdentifierStartChar ? r
? parseUpdateKeyword ([CI)Z ? ?
UPDATE K I parseDeleteKeyword ?
DELETE K I parseMoveKeyword ?
MOVE K I parseSelectKeyword ?
SELECT K I parseWithKeyword ?
WITH K I parseInsertKeyword ?
isEmpty ()Z ! n" INSERT$ K I% parseWithCommandType 6([CIII)Lcom/huawei/opengauss/jdbc/core/SqlCommandType;'(
) parseReturningKeyword+ ?
, parseValuesKeyword. ?
/ emptyList ()Ljava/util/List;12
X3 j temp bindIndex lastKeyWord currentCommandsTemp currentCommandsArr result command
wordLength aChar C
isKeyWordChar i isForceMultiCommands numOfOverSymble reg queryTemp queryArr haveSpecialKeyword
fragmentStart inParen
inBeginEnd aChars nativeSql Ljava/lang/StringBuilder;
bindPositions %Ljava/util/List; Ljava/util/List;
nativeQueries >Ljava/util/List; isCurrentReWriteCompatible
isValuesFound valuesBraceOpenPosition valuesBraceClosePosition valuesBraceCloseFound isInsertPresent isReturningPresent isReturningPresentPrev currentCommandType prevCommandType numberOfStatements whitespaceOnly keyWordCount keywordStart
keywordEnd lastQuery ,Lcom/huawei/opengauss/jdbc/core/NativeQuery; --e
startsWithg )
3h /*j */l contains (Ljava/lang/CharSequence;)Zno
3p str
s specialChar [
]v indexOf (Ljava/lang/String;I)Ixy
3z substring| ?
3} (Ljava/lang/String;)Ix?
3? index parseAsKeyword? ?
? nextChar nextInd
RETURNING ? charAt (I)C??
3? , ? $com/huawei/opengauss/jdbc/core/Utils? escapeIdentifier F(Ljava/lang/StringBuilder;Ljava/lang/String;)Ljava/lang/StringBuilder;??
??
columnName col ? list res charTerminatesIdentifier? r
? offset END? endsWith? )
3? PLPGSQL? SQL? 'PLPGSQL'? $? keyword BEGIN? DECLARE? hashCode? f
3? CREATE? TRIGGER? TABLE? PACKAGE? PROCEDURE? FUNCTION? firstWord hasCreate hasTable
hasTrigger isDollarQuoteStartChar? r
? isDollarQuoteContChar? r
? subArraysEqual ([CIII)Z??
? d tagIdx tagLen endIdx level isIfKeywordB f?
isLoopKeyword l? o? p?
isCaseKeyword c? a? s? e? parseLong (Ljava/lang/String;II)J (II)Ljava/lang/String;|?
3? java/lang/Long? (Ljava/lang/String;)J??
?? digitAt?y
?
beginIndex endIndex J isDigitAt (Ljava/lang/String;I)Z isDigit? r
p? pos java/lang/NumberFormatException
d Input string: "
", position: (I)Ljava/lang/StringBuilder; ?
d
(Ljava/lang/String;)V
isOperatorChar ,()[].;:+-*/%^<>=~!@#&|`? (I)Ix
3 isJavaIdentifierStart r
p isJavaIdentifierPart r
p r
arr offA offB len modifyJdbcCall I(Ljava/lang/String;ZII)Lcom/huawei/opengauss/jdbc/core/JdbcCallParseInfo; call# java/lang/IllegalStateException% somehow got into bad state '
&
0com/huawei/opengauss/jdbc/core/JdbcCallParseInfo* (Ljava/lang/String;ZZ)V ,
+- ,com/huawei/opengauss/jdbc/util/PSQLException/