MySQL types are mapped to scheme types as follows:
The SQL NULL value is represented by the unique value .
If you provide a real number as a parameter value to a prepared statement, the MySQL Client Library will send it to the server as a decimal string. To provide sufficient precision, the library will consult the decimals field of the parameter packet it received from the server (see MySQL Internals: Client/Server Protocol). If decimals is positive, it will encode the value as:
Otherwise, it will default to:
The SRFI 19 date struct type contains both date and time of day information, as well as timezone data. When an SQL DATE is mapped to an SRFI 19 date, the time of day data is zeroed out (and therefore corresponds to the very start of the day). When an SRFI 19 date is mapped back to an SQL DATE, the time of day data is simply ignored.
When the MySQL Client Library creates an SRFI 19 date value, its timezone offset is set to the offset of the local machine’s current locale. No automatic timezone adjustment is performed between client and server.
The MySQL Client Library communicates with the server using the UTF-8 encoding. (Note that this is completely independent of the encoding you have chosen for your database tables and/or columns. The MySQL server will re-encode your data into the appropriate character encoding for storage.)
Although MySQL allows users to change the character encoding of the client/server communication channel using the SET NAMES statement, you should not do this, as the client library has no way of detecting the change (short of parsing all SQL strings, looking for SET NAMES statements, which would be unreasonably expensive). Consequently, changing the encoding of the channel will likely result in data corruption.