You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "201811510411lw (via GitHub)" <gi...@apache.org> on 2026/01/22 07:20:07 UTC
[I] [Bug][JDBC] integer overflow when reading MySQL LONGTEXT with table_path + query [seatunnel]
201811510411lw opened a new issue, #10386:
URL: https://github.com/apache/seatunnel/issues/10386
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
### What happened
Using SeaTunnel JDBC source with MySQL, when a table has a LONGTEXT column and the config includes both `table_path` and `query`, the job fails during startup. The stack trace shows `java.lang.ArithmeticException: integer overflow` caused by `Math.toIntExact(column.getColumnLength())` in JdbcCatalogUtils.mergeCatalogTable.
### SeaTunnel Version
2.3.12-release
### SeaTunnel Config
```conf
env {
job.name = "jdbc-longtext-repro"
parallelism = 1
job.mode = "BATCH"
}
source {
Jdbc {
url = "jdbc:mysql://<host>:3306/<db>?useUnicode=true&characterEncoding=UTF-8&useSSL=false"
driver = "com.mysql.cj.jdbc.Driver"
user = "<user>"
password = "<password>"
table_list = [
{
table_path = "<db>.user"
query = """
SELECT id, config
FROM <db>.user
"""
}
]
}
}
sink { Console {} }
```
### Running Command
```shell
bin/start-seatunnel-flink-15-connector-v2.sh --config script/longtext.conf
```
### Error Exception
```log
Caused by: java.lang.ArithmeticException: integer overflow
at java.lang.Math.toIntExact(Math.java:1011)
at org.apache.seatunnel.connectors.seatunnel.jdbc.utils.JdbcCatalogUtils.lambda$mergeCatalogTable$5(JdbcCatalogUtils.java:341)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.apache.seatunnel.connectors.seatunnel.jdbc.utils.JdbcCatalogUtils.mergeCatalogTable(JdbcCatalogUtils.java:356)
at org.apache.seatunnel.connectors.seatunnel.jdbc.utils.JdbcCatalogUtils.getCatalogTable(JdbcCatalogUtils.java:210)
at org.apache.seatunnel.connectors.seatunnel.jdbc.utils.JdbcCatalogUtils.getTables(JdbcCatalogUtils.java:94)
at org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSource.<init>(JdbcSource.java:66)
at org.apache.seatunnel.connectors.seatunnel.jdbc.source.JdbcSourceFactory.lambda$createSource$0(JdbcSourceFactory.java:59)
at org.apache.seatunnel.api.table.factory.FactoryUtil.createAndPrepareSource(FactoryUtil.java:180)
at org.apache.seatunnel.api.table.factory.FactoryUtil.restoreAndPrepareSource(FactoryUtil.java:136)
... 25 more
```
### Zeta or Flink or Spark Version
_No response_
### Java or Scala Version
_No response_
### Screenshots
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][connector-jdbc] integer overflow when reading MySQL LONGTEXT with table_path + query [seatunnel]
Posted by "yzeng1618 (via GitHub)" <gi...@apache.org>.
yzeng1618 commented on issue #10386:
URL: https://github.com/apache/seatunnel/issues/10386#issuecomment-3783163078
Regarding this bug, I will fix this bug in the follow-up. Please stay tuned.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][connector-jdbc] integer overflow when reading MySQL LONGTEXT with table_path + query [seatunnel]
Posted by "201811510411lw (via GitHub)" <gi...@apache.org>.
201811510411lw commented on issue #10386:
URL: https://github.com/apache/seatunnel/issues/10386#issuecomment-3783502256
> Regarding this bug, I will fix this bug in the follow-up. Please stay tuned.
Thanks for the update. After removing `table_path` and using only `query`, the job runs successfully for the table with a LONGTEXT column. Appreciate the follow-up fix—looking forward to it.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][connector-jdbc] integer overflow when reading MySQL LONGTEXT with table_path + query [seatunnel]
Posted by "yzeng1618 (via GitHub)" <gi...@apache.org>.
yzeng1618 commented on issue #10386:
URL: https://github.com/apache/seatunnel/issues/10386#issuecomment-3783143768
The main cause of the current issue is: when table_path + query is used, it goes through JdbcCatalogUtils.mergeCatalogTable to perform table schema merging. For MySQL type mapping, LONGTEXT/LONGBLOB directly set columnLength = 2^32-1 = 4294967295L
. However, Column.columnLength itself is a Long, and casting it to int during merging triggers an ArithmeticException: integer overflow.
For now, if you are doing single-table synchronization, a temporary workaround is to use the query directly for synchronization without adding table_list. You can give this a try.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][connector-jdbc] integer overflow when reading MySQL LONGTEXT with table_path + query [seatunnel]
Posted by "201811510411lw (via GitHub)" <gi...@apache.org>.
201811510411lw commented on issue #10386:
URL: https://github.com/apache/seatunnel/issues/10386#issuecomment-3783496918
> The main cause of the current issue is: when table_path + query is used, it goes through JdbcCatalogUtils.mergeCatalogTable to perform table schema merging. For MySQL type mapping, LONGTEXT/LONGBLOB directly set columnLength to 2^32-1 . However, Column.columnLength itself is a Long, and casting it to int during merging triggers an ArithmeticException: integer overflow.
>
> For now, if you are doing single-table synchronization, a temporary workaround is to use the query directly for synchronization without adding table_list. You can give this a try.
>
> ```
> env {
> job.name = "jdbc-longtext-repro"
> parallelism = 1
> job.mode = "BATCH"
> }
>
> source {
> Jdbc {
> url = "jdbc:mysql://<host>:3306/<db>?useUnicode=true&characterEncoding=UTF-8&useSSL=false"
> driver = "com.mysql.cj.jdbc.Driver"
> user = "<user>"
> password = "<password>"
> query ="SELECT id, config FROM <db>.user"
> }
> }
>
> sink { Console {} }
> ```
<img width="1046" height="821" alt="Image" src="https://github.com/user-attachments/assets/feb05729-5d7d-4403-b766-df6ac71b445a" />
--
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.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][connector-jdbc] integer overflow when reading MySQL LONGTEXT with table_path + query [seatunnel]
Posted by "201811510411lw (via GitHub)" <gi...@apache.org>.
201811510411lw closed issue #10386: [Bug][connector-jdbc] integer overflow when reading MySQL LONGTEXT with table_path + query
URL: https://github.com/apache/seatunnel/issues/10386
--
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.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org