Package com.mysql.cj
Class ParseInfo
java.lang.Object
com.mysql.cj.ParseInfo
public class ParseInfo
extends java.lang.Object
Represents the "parsed" state of a prepared query, with the statement broken up into its static and dynamic (where parameters are bound) parts.
-
Field Summary
Fields Modifier and Type Field Description int
numberOfQueries
protected static java.lang.String[]
ON_DUPLICATE_KEY_UPDATE_CLAUSE
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected static boolean
canRewrite(java.lang.String sql, boolean isOnDuplicateKeyUpdate, int locationOfOnDuplicateKeyUpdate, int statementStartPos)
boolean
canRewriteAsMultiValueInsertAtSqlLevel()
boolean
containsOnDuplicateKeyUpdateInSQL()
protected static int
findStartOfStatement(java.lang.String sql)
char
getFirstStmtChar()
int
getLocationOfOnDuplicateKeyUpdate()
static int
getOnDuplicateKeyLocation(java.lang.String sql, boolean dontCheckOnDuplicateKeyUpdateInSQL, boolean rewriteBatchedStatements, boolean noBackslashEscapes)
ParseInfo
getParseInfoForBatch(int numBatch)
Returns a ParseInfo for a multi-value INSERT for a batch of size numBatch (without parsing!).java.lang.String
getSqlForBatch()
Used for filling in the SQL for getPreparedSql() - for debuggingjava.lang.String
getSqlForBatch(int numBatch)
Returns a preparable SQL string for the number of batched parameters; used by server-side prepared statements when re-writing batch INSERTs.byte[][]
getStaticSql()
java.lang.String
getValuesClause()
boolean
isFoundLoadData()
-
Field Details
-
ON_DUPLICATE_KEY_UPDATE_CLAUSE
protected static final java.lang.String[] ON_DUPLICATE_KEY_UPDATE_CLAUSE -
numberOfQueries
public int numberOfQueries
-
-
Constructor Details
-
Method Details
-
getStaticSql
public byte[][] getStaticSql() -
getValuesClause
public java.lang.String getValuesClause() -
getLocationOfOnDuplicateKeyUpdate
public int getLocationOfOnDuplicateKeyUpdate() -
canRewriteAsMultiValueInsertAtSqlLevel
public boolean canRewriteAsMultiValueInsertAtSqlLevel() -
containsOnDuplicateKeyUpdateInSQL
public boolean containsOnDuplicateKeyUpdateInSQL() -
getParseInfoForBatch
Returns a ParseInfo for a multi-value INSERT for a batch of size numBatch (without parsing!).- Parameters:
numBatch
- number of batched parameters- Returns:
ParseInfo
-
getSqlForBatch
public java.lang.String getSqlForBatch(int numBatch) throws java.io.UnsupportedEncodingExceptionReturns a preparable SQL string for the number of batched parameters; used by server-side prepared statements when re-writing batch INSERTs.- Parameters:
numBatch
- number of batched parameters- Returns:
- SQL string
- Throws:
java.io.UnsupportedEncodingException
- if an error occurs
-
getSqlForBatch
public java.lang.String getSqlForBatch() throws java.io.UnsupportedEncodingExceptionUsed for filling in the SQL for getPreparedSql() - for debugging- Returns:
- sql string
- Throws:
java.io.UnsupportedEncodingException
- if an error occurs
-
findStartOfStatement
protected static int findStartOfStatement(java.lang.String sql) -
getOnDuplicateKeyLocation
public static int getOnDuplicateKeyLocation(java.lang.String sql, boolean dontCheckOnDuplicateKeyUpdateInSQL, boolean rewriteBatchedStatements, boolean noBackslashEscapes) -
canRewrite
protected static boolean canRewrite(java.lang.String sql, boolean isOnDuplicateKeyUpdate, int locationOfOnDuplicateKeyUpdate, int statementStartPos) -
isFoundLoadData
public boolean isFoundLoadData() -
getFirstStmtChar
public char getFirstStmtChar()
-