gpt4 book ai didi

mysql - 将类型从简单字符串更改为文本后的 Grails - 第 1 行的 'text' 列的数据太长

转载 作者:行者123 更新时间:2023-11-29 22:01:30 27 4
gpt4 key购买 nike

在域级别的 grails 2.3.4 中,我添加了一段新代码:

static mapping = {
text type: "text"
}

之前我只有带有名称文本的简单变量。我将 sql 类型更改为文本(TEXT - 65,535 字节)。但是当我试图保存 50 000 个字符时,我得到:

Data truncation: Data too long for column 'text' at row 1. Stacktrace follows:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'text' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4118)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)
at nl.mycubes.questionnaire.engine.QuestionnaireService$_saveLabels_closure21.doCall(QuestionnaireService.groovy:577)
at nl.mycubes.questionnaire.engine.QuestionnaireService.saveLabels(QuestionnaireService.groovy:560)
at nl.mycubes.questionnaire.engine.QuestionnaireService.saveQuestion(QuestionnaireService.groovy:502)
at nl.mycubes.questionnaire.engine.TreeController.saveQuestion(TreeController.groovy:316)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:49)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

最佳答案

只需删除并创建新数据库即可。它应该按预期工作正常..

关于mysql - 将类型从简单字符串更改为文本后的 Grails - 第 1 行的 'text' 列的数据太长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32609952/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com