Menu

#1531 MySQL unsigned smallint

SQuirreL
open
nobody
None
medium
2026-06-07
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 - 2026-05-20

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

       
  • Gerd Wagner

    Gerd Wagner - 2026-06-07

    Sorry, I can't reproduce your problem on my MySQL-instance 8.0.17 with JDBC driver version "mysql-connector-java-8.0.15". I can only reproduce it when the SQuirreL's MySQL-Plugin is not installed.
    You may look at menu Plugins --> Summary to check if the MySqlPlugin is installed. If not you may reinstall SQuirreL and during the installation choose to install the Plugin.
    You can find the latest installer versions here:
    https://sourceforge.net/projects/squirrel-sql/files/3-snapshots/snapshot-20260531_2129/
    Or the latest stable version here:
    https://sourceforge.net/projects/squirrel-sql/files/1-stable/5.1.0/

     

Log in to post a comment.