[source-mysql] Incremental sync skips records when cursor field has microsecond precision - timestamp truncated in JDBC query
- Lingua principale
- Python
- Stelle
- 22.1k
- Fork
- 5.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
### Connector Name
source-mysql
### Connector Version
3.50.9
### What step the error happened?
During the sync
### Relevant information
## Summary
Incremental sync with cursor-based replication consistently returns 0 records even when records exist in the source DB within the query range. Sync completes successfully but no data is loaded, and the stream state still advances — causing the stream to get stuck on subsequent syncs.
## Environment
- Airbyte version: 1.8.5
- Source DB: MariaDB 10.11.13 on Amazon RDS
- Replication method: Standard (cursor-based)
- Cursor field: `modified` (DATETIME(6))
- JDBC params tested: `sendFractionalSeconds=true`, `useServerPrepStmts=true`, `profileSQL=true`
## What's happening
Airbyte binds parameters with full microseconds:
```
parameter #1 = "2026-04-14T16:10:47.148758"
parameter #2 = "2026-04-14T16:27:33.726846"
→ read 0 record(s)
```
But `profileSQL=true` shows microseconds are truncated in the actual query sent to DB:
```sql
WHERE (`modified` > '2026-04-14 16:10:47')
AND (`modified` <= '2026-04-14 16:27:33')
```
Manual query confirms the difference:
```sql
-- Returns 0 rows (same as Airbyte sends):
WHERE modified > '2026-04-14 16:10:47'
AND modified <= '2026-04-14 16:27:33'
-- Returns 1 row (with microseconds):
WHERE modified > '2026-04-14 16:10:47.000000'
AND modified <= '2026-04-14 16:27:33.726846'
```
The record has `modified = '2026-04-14 16:27:33.726846'` — excluded by `<= '16:27:33'` because `.726846 > .000000`.
## What I've tried
- `sendFractionalSeconds=true` — no effect
- `sendFractionalSecondsForTime=true` — no effect
- `useServerPrepStmts=true` — no effect
- `useServerPrepStmts=false` — no effect
## Questions
1. Has anyone encountered this with MariaDB and cursor fields with microsecond precision?
2. Is there a JDBC URL parameter that preserves fractional seconds when binding datetime parameters?
3. Is this a known issue with source-mysql on MariaDB?
### Relevant log output
```shell
DefaultDispatcher-worker-16#_12847995f47a0358.tabMaterial-round-1-partition-1-read i.a.c.r.JdbcSelectQuerier$Result(initQueryExecution):100 Setting parameter #1 to Binding(value="2026-04-14T16:10:47.148758", type=LocalDateTimeFieldType).
DefaultDispatcher-worker-16#_12847995f47a0358.tabMaterial-round-1-partition-1-read i.a.c.r.JdbcSelectQuerier$Result(initQueryExecution):100 Setting parameter #2 to Binding(value="2026-04-14T16:27:33.726846", type=LocalDateTimeFieldType).
[EXECUTE] SELECT ... FROM tabMaterial WHERE (`modified` > '2026-04-14 16:10:47') AND (`modified` <= '2026-04-14 16:27:33')
FeedReader(readPartitionWithResources):258 read 0 record(s) from partition 1
FeedReader(awaitAllPartitionReaders):336 updated state of tabMaterial, moved it 0 record(s) forward
```
### Contribute
- [ ] Yes, I want to contribute
---
**Internal Tracking:** https://github.com/airbytehq/oncall/issues/11971
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.