Commit 891998c
committed
mysql_srv: output mysql datetime/timestas as TimestampTZ
We have out own implementation of Datetime/Timestamp called
TimestampTZ. This object has a 3 bytes bitmap that gives us better
control over printing date only, timestamp with tz even if tz is zero
and microsecond precision even if it is zero.
Currently we were converting the TimestampTZ to NaiveDateTime and then
printing it. This was causing some issues with MySQL and datetime.
NaiveDateTime has an inner object called NaiveTime to represent time.
When printing naive time, if the microsecond is zero, it is not
printed [0]. For MySQL, if the Datetime column has the optional
microsecond precision set, we need to print the microsecond even if
it is zero, causing a mismatch between the readyset and MySQL.
This commit changes the display object for datetime/tz columns to
TimestampTZ and implement text and binary protocol trait for it.
Ref: REA-4490
Ref: #1309
[0]: https://github.com/chronotope/chrono/blob/v0.4.38/src/naive/time/mod.rs#L1520
Change-Id: I31301b20bebdd1bb33dbf6b79b84a8f7065dee80
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/7655
Tested-by: Buildkite CI
Reviewed-by: Michael Zink <michael.z@readyset.io>1 parent 7fe18b1 commit 891998c
2 files changed
+66
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
509 | 574 | | |
510 | 575 | | |
511 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 142 | + | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
| |||
0 commit comments