enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.34k stars 323 forks source link

Review the handling of Fixed Width fields #8718

Open jdunkerley opened 8 months ago

jdunkerley commented 8 months ago

Want to verify how SQLite, Postgres, MySQL and SQL Server all handle fixed width strings. Only have Postgres for now.

Don't pad to full length (at least not in Postgres).

Want to check:

We need to be able to round trip from the database to memory and back writing consistent.

Cassandra-Clark commented 7 months ago

SQL Server

length is set to fixed and automatically pads to full length. Concatenation will attempt to concatenate at the end of the padded value by default Equality ignores trailing spaces, so 'MYTEXT ' is the same as 'MYTEXT' or 'MYTEXT '

Cassandra-Clark commented 7 months ago

Postgres

Postgres Length is set to fixed but does not pad Postgres Concatenation does not automatically pad values by default in fixed width Postgres Equality ignores trailing spaces

Cassandra-Clark commented 7 months ago

MySQL

MySQL will pad trailing whitespace on load, but on retrieval will remove that whitespace unless PAD_CHAR_TO_FULL_LENGTH mode is set. This also impacts concatenation, by default the concatenation will not pad values in fixed width concatenation unless this mode is set. MySQL Equality ignores trailing spaces