zshit opened a new issue #5133:
URL: https://github.com/apache/skywalking/issues/5133


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [] Question or discussion
   - [x] Bug
   - [x] Requirement
   - [] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   ___
   ### Bug
   - Which version of SkyWalking, OS and JRE?
    SkyWalking : master, commitID 8b46e5c5b
    OS : Red Hat 4.8.5-36
    JRE :  1.8.0_77-b03
   
   - Which company or project?
   
   - What happen?
   If possible, provide a way for reproducing the error. e.g. demo application, 
component version.
   ``` java
   String sqlStatement = tag.getValue();
                       if (StringUtil.isEmpty(sqlStatement)) {
                           statement.setStatement("[No statement]/" + 
sourceBuilder.getDestEndpointName());
                       } else if (sqlStatement.length() > 
config.getMaxSlowSQLLength()) {
                           statement.setStatement(sqlStatement.substring(0, 
config.getMaxSlowSQLLength()));
                       } else {
                           statement.setStatement(sqlStatement);
                       }
   ```
   the max length of filed 'comment' supported for code 
MultiScopesAnalysisListener.java:215 is 2000, but the type of field 'comment' 
in table 'top_n_database_statement'  is varchar(200)
   
   ```java 2020-07-20 11:39:49,353 - 
org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao.H2BatchDAO - 75 
[pool-4-thread-1] ERROR [] - Data truncation: Data too long for column 
'statement' at row 1
   com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too 
long for column 'statement' at row 1
        at 
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
 ~[mysql-connector-java-8.0.13.jar:8.0.13]
        at 
com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:634)
 ~[mysql-connector-java-8.0.13.jar:8.0.13]
        at 
com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:414)
 ~[mysql-connector-java-8.0.13.jar:8.0.13]
        at 
com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:391)
 ~[mysql-connector-java-8.0.13.jar:8.0.13]
        at 
com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
 ~[HikariCP-3.1.0.jar:?]
        at 
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
 ~[HikariCP-3.1.0.jar:?]
        at 
org.apache.skywalking.oap.server.storage.plugin.jdbc.SQLExecutor.invoke(SQLExecutor.java:53)
 ~[storage-jdbc-hikaricp-plugin-8.1.0-SNAPSHOT.jar:8.1.0-SNAPSHOT]
        at 
org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao.H2BatchDAO.synchronous(H2BatchDAO.java:72)
 ~[storage-jdbc-hikaricp-plugin-8.1.0-SNAPSHOT.jar:8.1.0-SNAPSHOT]
        at 
org.apache.skywalking.oap.server.core.storage.PersistenceTimer.extractDataAndSave(PersistenceTimer.java:122)
 ~[server-core-8.1.0-SNAPSHOT.jar:8.1.0-SNAPSHOT]
        at 
org.apache.skywalking.oap.server.core.storage.PersistenceTimer.lambda$start$0(PersistenceTimer.java:78)
 ~[server-core-8.1.0-SNAPSHOT.jar:8.1.0-SNAPSHOT]
        at 
org.apache.skywalking.apm.util.RunnableWithExceptionProtection.run(RunnableWithExceptionProtection.java:33)
 [apm-util-8.1.0-SNAPSHOT.jar:8.1.0-SNAPSHOT]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
[?:1.8.0_77]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) 
[?:1.8.0_77]
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
 [?:1.8.0_77]
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
 [?:1.8.0_77]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[?:1.8.0_77]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[?:1.8.0_77]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
   ```
   
   ___
   ### Requirement or improvement
   - Please describe about your requirements or improvement suggestions.
   change TopN.java
   before:
   @Column(columnName = STATEMENT, storageOnly = true)
   private String statement;
   after:
   @Column(columnName = STATEMENT, length = 8192, storageOnly = true)
   private String statement;
   
   then delete database 'swtest' and restart skywalking in init mode .
   
   Is there a way to modiy the typs of database fileds when we had to upgrade 
skywalking ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to