New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To terryManu #4946
Comments
Hi, @nevereverever thx for your attention.
|
1.when using '' ,it print: [DEBUG] 09:37:18.846 [pool-7-thread-1] c.p.p.s.r.s.SimpleHashShardingAlgorithm - simpleHashShardingAlgorithm--shardingCount:2,columnName:personid,tableName:tbperson,columnValue:1,recent return target is : ds_1 if using "",this log will not print,result in mysql command line: INSERT INTO `sharding_db`.`tbperson`(`personId`, `name`, `lastUpdateTime`, `account`) VALUES ("2", "oho", "2020-02-12 20:47:10", 3.00)
> Affected rows: 2
> 时间: 0.023s 2.yes.But my company cannot upload pictures due to firewall. Error updating database. Cause: java.sql.SQLException: 2Unknown exception: [null] I find the nullException in this code: private List<Object> getParameters(final MySQLPacketPayload payload, final int parametersCount) throws SQLException {
List<Object> result = new ArrayList<>(parametersCount);
for (int parameterIndex = 0; parameterIndex < parametersCount; parameterIndex++) {
MySQLBinaryProtocolValue binaryProtocolValue = MySQLBinaryProtocolValueFactory.getBinaryProtocolValue(binaryStatement.getParameterTypes().get(parameterIndex).getColumnType());
result.add(nullBitmap.isNullParameter(parameterIndex) ? null : binaryProtocolValue.read(payload));
}
return result;
}
3.this message is throw by my code,I know it,but single Mysql: ps = {JDBC42PreparedStatement@2402} "com.mysql.jdbc.JDBC42PreparedStatement@4c88d27e: replace into psn_insu_rlts_d_bak (ADMDVS_NAME,CLCT_WAY,CRT_INSU_DATE,OPTINS,EMP_FOM,INSU_OPTINS,HI_TYPE,CLCT_RULE_TYPE_CODG,CRTE_OPTINS,CLCTSTD_CRTF_RULE_CODG,INSUTYPE_RETR_FLAG,OPT_TIME,INSUTYPE,AS_CLCT_MONTH,UPDT_TIME,PAUS_INSU_DATE,EMP_NO,CRTER_NAME,PSN_INSU_STAS,ACCT_CRTN_YM,CRT_PATC_JOB_DATE,INSU_PSN_MGT_EID,CERTNO,FST_INSU_YM,OPTER_NAME,CRTER,QUTS_TYPE,PSN_INSU_RLTS_ID,FM_ID,PSN_CERT_TYPE,BEGN_YM,POOLAREA,INSU_IDET,PSN_NO,PSN_TYPE,END_YM,PSN_CLCT_STAS,MAX_ACCTPRD,THISTIME_BEGN_DATE,PSN_INSU_DATE,SYS_CODE,CRTE_TIME,ADMDVS,OPTER) values (** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** NOT SPECIFIED **,** "
batchHasPlainStatements = false
dbmd = {JDBC4DatabaseMetaData@2406}
firstCharOfStmt = 'R' 82
isLoadDataQuery = false
isNull = {boolean[88000]@2407}
isStream = {boolean[88000]@2408}
numberOfExecutions = 0
originalSql = "replace into psn_insu_rlts_d_bak (ADMDVS_NAME,CLCT_WAY,CRT_INSU_DATE,OPTINS,EMP_FOM,INSU_OPTINS,HI_TYPE,CLCT_RULE_TYPE_CODG,CRTE_OPTINS,CLCTSTD_CRTF_RULE_CODG,INSUTYPE_RETR_FLAG,OPT_TIME,INSUTYPE,AS_CLCT_MONTH,UPDT_TIME,PAUS_INSU_DATE,EMP_NO,CRTER_NAME,PSN_INSU_STAS,ACCT_CRTN_YM,CRT_PATC_JOB_DATE,INSU_PSN_MGT_EID,CERTNO,FST_INSU_YM,OPTER_NAME,CRTER,QUTS_TYPE,PSN_INSU_RLTS_ID,FM_ID,PSN_CERT_TYPE,BEGN_YM,POOLAREA,INSU_IDET,PSN_NO,PSN_TYPE,END_YM,PSN_CLCT_STAS,MAX_ACCTPRD,THISTIME_BEGN_DATE,PSN_INSU_DATE,SYS_CODE,CRTE_TIME,ADMDVS,OPTER) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,"
parameterCount = 88000
parameterMetaData = null
parameterStreams = {InputStream[88000]@2409}
parameterValues = {byte[88000][]@2411}
parameterTypes = {int[88000]@2413}
parseInfo = {PreparedStatement$ParseInfo@2414}
pstmtResultMetaData = null
staticSqlStrings = {byte[88001][]@2415}
streamConvertBuf = null
streamLengths = {int[88000]@2416}
tsdf = null
ddf = null
tdf = null
useTrueBoolean = true
usingAnsiMode = false
batchedValuesClause = null
doPingInstead = false
compensateForOnDuplicateKeyUpdate = false
charsetEncoder = null
batchCommandIndex = -1
serverSupportsFracSecs = true
rewrittenBatchSize = 0
cancelTimeoutMutex = {Object@2417}
wasCancelled = false
wasCancelledByTimeout = false
batchedArgs = null
charConverter = null
charEncoding = "UTF-8"
connection = {JDBC4Connection@2385}
physicalConnection = null
connectionId = 84151
currentCatalog = "db02"
doEscapeProcessing = true
eventSink = null
fetchSize = 0
isClosed = false
lastInsertId = -1
maxFieldSize = 67108864
maxRows = -1
openResults = {HashSet@2420} size = 0
pedantic = false
pointOfOrigin = null
profileSQL = false
results = null
generatedKeysResults = null
resultSetConcurrency = 1007
resultSetType = 1003
statementId = 0
timeoutInMillis = 0
updateCount = -1
useUsageAdvisor = false
warningChain = null
clearWarningsCalled = false
holdResultsOpenOverClose = false
batchedGeneratedKeys = null
retrieveGeneratedKeys = false
continueBatchOnError = true
pingTarget = null
useLegacyDatetimeCode = true
sendFractionalSeconds = true
exceptionInterceptor = null
lastQueryIsOnDupKeyUpdate = false
statementExecuting = {AtomicBoolean@2421} "false"
isImplicitlyClosingResults = false
originalResultSetType = 0
originalFetchSize = 0
isPoolable = true
localInfileInputStream = null
version5013OrNewer = true
closeOnCompletion = false sharding-proxy: ps = {JDBC42ServerPreparedStatement@2398} "com.mysql.jdbc.ServerPreparedStatement[1] - replace into psn_insu_rlts_d_bak (ADMDVS_NAME,CLCT_WAY,CRT_INSU_DATE,OPTINS,EMP_FOM,INSU_OPTINS,HI_TYPE,CLCT_RULE_TYPE_CODG,CRTE_OPTINS,CLCTSTD_CRTF_RULE_CODG,INSUTYPE_RETR_FLAG,OPT_TIME,INSUTYPE,AS_CLCT_MONTH,UPDT_TIME,PAUS_INSU_DATE,EMP_NO,CRTER_NAME,PSN_INSU_STAS,ACCT_CRTN_YM,CRT_PATC_JOB_DATE,INSU_PSN_MGT_EID,CERTNO,FST_INSU_YM,OPTER_NAME,CRTER,QUTS_TYPE,PSN_INSU_RLTS_ID,FM_ID,PSN_CERT_TYPE,BEGN_YM,POOLAREA,INSU_IDET,PSN_NO,PSN_TYPE,END_YM,PSN_CLCT_STAS,MAX_ACCTPRD,THISTIME_BEGN_DATE,PSN_INSU_DATE,SYS_CODE,CRTE_TIME,ADMDVS,OPTER) values (null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,n"
hasOnDuplicateKeyUpdate = false
detectedLongParameterSwitch = false
fieldCount = 0
invalid = false
invalidationException = null
outByteBuffer = null
parameterBindings = {ServerPreparedStatement$BindValue[22464]@2404}
parameterFields = {Field[22464]@2406}
resultFields = null
sendTypesToServer = false
serverStatementId = 1
stringTypeCode = 253
serverNeedsResetBeforeEachExecution = false
isCached = false
useAutoSlowLog = true
serverTzCalendar = null
defaultTzCalendar = null
hasCheckedRewrite = false
canRewrite = false
locationOfOnDuplicateKeyUpdate = -2
batchHasPlainStatements = false
dbmd = null
firstCharOfStmt = 'R' 82
isLoadDataQuery = false
isNull = null
isStream = null
numberOfExecutions = 0
originalSql = "replace into psn_insu_rlts_d_bak (ADMDVS_NAME,CLCT_WAY,CRT_INSU_DATE,OPTINS,EMP_FOM,INSU_OPTINS,HI_TYPE,CLCT_RULE_TYPE_CODG,CRTE_OPTINS,CLCTSTD_CRTF_RULE_CODG,INSUTYPE_RETR_FLAG,OPT_TIME,INSUTYPE,AS_CLCT_MONTH,UPDT_TIME,PAUS_INSU_DATE,EMP_NO,CRTER_NAME,PSN_INSU_STAS,ACCT_CRTN_YM,CRT_PATC_JOB_DATE,INSU_PSN_MGT_EID,CERTNO,FST_INSU_YM,OPTER_NAME,CRTER,QUTS_TYPE,PSN_INSU_RLTS_ID,FM_ID,PSN_CERT_TYPE,BEGN_YM,POOLAREA,INSU_IDET,PSN_NO,PSN_TYPE,END_YM,PSN_CLCT_STAS,MAX_ACCTPRD,THISTIME_BEGN_DATE,PSN_INSU_DATE,SYS_CODE,CRTE_TIME,ADMDVS,OPTER) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?),(?,"
parameterCount = 22464
parameterMetaData = null
parameterStreams = null
parameterValues = null
parameterTypes = {int[22464]@2408}
parseInfo = null
pstmtResultMetaData = null
staticSqlStrings = null
streamConvertBuf = null
streamLengths = null
tsdf = null
ddf = null
tdf = null
useTrueBoolean = true
usingAnsiMode = false
batchedValuesClause = null
doPingInstead = false
compensateForOnDuplicateKeyUpdate = false
charsetEncoder = null
batchCommandIndex = -1
serverSupportsFracSecs = true
rewrittenBatchSize = 0
cancelTimeoutMutex = {Object@2409}
wasCancelled = false
wasCancelledByTimeout = false
batchedArgs = null
charConverter = null
charEncoding = "UTF-8"
connection = {JDBC4Connection@2387}
physicalConnection = null
connectionId = 2
currentCatalog = "sharding_db"
doEscapeProcessing = true
eventSink = null
fetchSize = 0
isClosed = false
lastInsertId = -1
maxFieldSize = 67108864
maxRows = -1
openResults = {HashSet@2412} size = 0
pedantic = false
pointOfOrigin = null
profileSQL = false
results = null
generatedKeysResults = null
resultSetConcurrency = 1007
resultSetType = 1003
statementId = 0
timeoutInMillis = 0
updateCount = -1
useUsageAdvisor = false
warningChain = null
clearWarningsCalled = false
holdResultsOpenOverClose = false
batchedGeneratedKeys = null
retrieveGeneratedKeys = false
continueBatchOnError = true
pingTarget = null
useLegacyDatetimeCode = true
sendFractionalSeconds = true
exceptionInterceptor = null
lastQueryIsOnDupKeyUpdate = false
statementExecuting = {AtomicBoolean@2413} "false"
isImplicitlyClosingResults = false
originalResultSetType = 0
originalFetchSize = 0
isPoolable = true
localInfileInputStream = null
version5013OrNewer = true
closeOnCompletion = false this parameter |
By the way,I know using long values is not a good way to use it in mysql,I tend to use |
Thank you the feedback. It is better to send mailing list for this issue. It is better to aggregate the information in same issue, separate into serval issues are difficult to search by users. |
The title of the issue is not user friendly and maybe no value for other users. So I just close this issue, please add more necessary information in the suitable issues. |
Dear terryManu:
I've been using sharding proxy for two months,and try to use it in the project.I reported some questions,some of them were closed before they were solved, and some of them got good feedback.No one will reply to those who have been shut down. I'm here to retell the definite problems I have encountered.Sharding proxy is an excellent open source product, but there are still many problems. I have fixed some bugs in my own project. I hope you can also pay attention to it
(1)I use this sharding rule to split my table,but using ""(Double quotation marks) will route to all table node:
this is the sharding rule:
(2)preparedstatement mode can greatly enhance performance, but there is a big bug when using multithreading has thread problems.Because of using English, I can't describe this problem very well,I fixed this bug by using ThreadLocal in
MySQLBinaryStatement
. I'm sure you'll see what I mean.This is my code:
(3)And,when using preparedstatement in jdbc,if the sql is large enough,parameter will be cutted lead to 'java.sql.SQLException: Parameter index out of bounds. 22465 is not between valid values of 1 and 22464'.I debugger it,find preparedstatement returns different with single Mysql,parameterCount is wrong.
you sincerely
YoungLu
The text was updated successfully, but these errors were encountered: