Skip to content

Commit

Permalink
Add TEXT integration and correct README for it
Browse files Browse the repository at this point in the history
  • Loading branch information
mirromutth committed Dec 22, 2023
1 parent 7b770f3 commit 8661eb9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ If you want to raise an issue, please follow the recommendations below:
- The MySQL server does not **actively** return time zone when query `DATETIME` or `TIMESTAMP`, this driver does not attempt time zone conversion. That means should always use `LocalDateTime` for SQL type `DATETIME` or `TIMESTAMP`. Execute `SHOW VARIABLES LIKE '%time_zone%'` to get more information.
- Should not turn-on the `trace` log level unless debugging. Otherwise, the security information may be exposed through `ByteBuf` dump.
- If `Statement` bound `returnGeneratedValues`, the `Result` of the `Statement` can be called both: `getRowsUpdated` to get affected rows, and `map` to get last inserted ID.
- The MySQL may be not support search rows by a binary field, like `BIT`, `BLOB` and `JSON`, because those data fields maybe just an address of reference in MySQL server, or maybe need strict bit-aligned. (but `VARBINARY` is OK)
- The MySQL may be not support well for searching rows by a binary field, like `BIT` and `JSON`
- `BIT`: cannot select 'BIT(64)' with value greater than 'Long.MAX_VALUE' (or equivalent in binary)
- `JSON`: different MySQL may have different serialization formats, e.g. MariaDB and MySQL

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ void varbinary() {
ByteBuffer.wrap(new byte[] { 1, 2, 3, 4, 5 }));
}

@Test
void text() {
testType(byte[].class, true, "TEXT", null, new byte[0], new byte[] { 1, 2, 3, 4, 5 });
testType(ByteBuffer.class, true, "TEXT", null, ByteBuffer.allocate(0),
ByteBuffer.wrap(new byte[] { 1, 2, 3, 4, 5 }));
}

@Test
void bit() {
testType(Boolean.class, true, "BIT(1)", null, false, true);
Expand Down

0 comments on commit 8661eb9

Please sign in to comment.