Menu

#1531 MySQL unsigned smallint

SQuirreL
open
nobody
None
medium
4 days ago
2024-11-13
No

MySQL has SMALLINT UNSIGNED data type, see:
https://dev.mysql.com/doc/refman/8.4/en/integer-types.html
If such a number is greater than 32767, "ERROR" is displayed.

it's probably the same problem as in issue: https://sourceforge.net/p/squirrel-sql/bugs/1050/

Here is stackstrace:

2024-11-13 09:00:35:872 [pool-1-thread-1] ERROR  net.sourceforge.squirrel_sql.fw.sql.ResultSetReader  - Error reading column data, column index = 1
java.sql.SQLDataException: Value '48772' is outside of valid range for type java.lang.Short
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:106)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:81)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:55)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:65)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:83)
    at com.mysql.cj.jdbc.result.ResultSetImpl.getObject(ResultSetImpl.java:1349)
    at com.mysql.cj.jdbc.result.ResultSetImpl.getShort(ResultSetImpl.java:855)
    at net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeShort.readResultSet(DataTypeShort.java:373)
    at net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.CellComponentFactory.readResultSet(CellComponentFactory.java:500)
    at net.sourceforge.squirrel_sql.fw.sql.ResultSetReader.doContentTabRead(ResultSetReader.java:660)
    at net.sourceforge.squirrel_sql.fw.sql.ResultSetReader.readRow(ResultSetReader.java:189)
    at net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet.createRow(ResultSetDataSet.java:233)
    at net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet._setResultSet(ResultSetDataSet.java:199)
    at net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet.setSqlExecutionTabResultSet(ResultSetDataSet.java:128)
    at net.sourceforge.squirrel_sql.client.session.mainpanel.SQLExecutionHandler.sqlResultSetAvailable(SQLExecutionHandler.java:420)
    at net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.processResultSet(SQLExecuterTask.java:552)
    at net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.processQuery(SQLExecuterTask.java:420)
    at net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.runDirect(SQLExecuterTask.java:214)
    at net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.run(SQLExecuterTask.java:137)
    at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
    at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: com.mysql.cj.exceptions.NumberOutOfRange: Value '48772' is outside of valid range for type java.lang.Short
    at com.mysql.cj.result.ShortValueFactory.createFromLong(ShortValueFactory.java:53)
    at com.mysql.cj.result.ShortValueFactory.createFromLong(ShortValueFactory.java:35)
    at com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeUInt2(MysqlTextValueDecoder.java:100)
    at com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:96)
    at com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:235)
    at com.mysql.cj.protocol.a.result.ByteArrayRow.getValue(ByteArrayRow.java:82)
    at com.mysql.cj.jdbc.result.ResultSetImpl.getObject(ResultSetImpl.java:1249)
    ... 15 more

Discussion

  • Gerd Wagner

    Gerd Wagner - 2024-11-17

    Fixed in our GIT repositories. Will be available in future snapshots and versions.

    Excerpt from change log:

    '#1531 MySQL Plugin: SMALLINT UNSIGNED columns showed <Error> when the fields value exceeded 32767.
    Note: To work with MYSQL's SMALLINT UNSIGNED or TINYINT UNSIGNED types the MySQL Plugin must be installed.

     

    Last edit: Gerd Wagner 2024-11-17
    • Kirillz

      Kirillz - 4 days ago

      Hello! Seems that the fix is not in the latest stable version yet (5.1.0 for now) . Is there any plans for it?

       

Log in to post a comment.

MongoDB Logo MongoDB