Commit 860925e
committed
Adjust MySQL ColumnDefinitions
This commits aims to make Readyset ColumnDefinition package more
aligned with MySQL's ColumnDefinition package.
The main changes are:
- Add `decimals` to the `Column` struct.
- Made `column_length` non optional. Before we were always returning
it to 1024. Now we have proper lenght based on field type.
- Adjusted most of the Flags to match MySQL.
- Added `sql_type` to `ColumnBase`. Some DfTypes don't record the
precision, like all sql text fields (TinyText, MediumText, LongText)
translate to DfType::Text, they all have a different length. MySQL
Boolean come as tinyint(1) during snapshot, but Boolean during
replication.
Added an integration test to validate we are returning same
column definitions for both upstream MySQL and Readyset.
Closes: REA-4505
Closes: #1321
Release-Note-Core: Adjust MySQL ColumnDefinitions to match MySQL.
Some drivers, like ruby-mysql2, use the column definition to round
decimal numbers.
Change-Id: I1a2c2e7fe5915b32d9f96cb600c408c6b20c874b
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/9075
Tested-by: Buildkite CI
Reviewed-by: Michael Zink <michael.z@readyset.io>1 parent 6b6c815 commit 860925e
File tree
11 files changed
+589
-131
lines changed- mysql-srv
- src
- value
- tests
- readyset-client/src
- readyset-mysql
- src
- tests
- readyset-server/src/controller
11 files changed
+589
-131
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | | - | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
109 | | - | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
| |||
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
229 | | - | |
| 232 | + | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| |||
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
244 | | - | |
| 250 | + | |
245 | 251 | | |
246 | 252 | | |
| 253 | + | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
916 | | - | |
| 916 | + | |
917 | 917 | | |
918 | 918 | | |
| 919 | + | |
919 | 920 | | |
920 | 921 | | |
921 | 922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
145 | | - | |
| 144 | + | |
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
| |||
0 commit comments