Skip to content

Commit 1fe1b23

Browse files
goffrieConvex, Inc.
authored andcommitted
Use mysql x'baba' syntax instead of unhex('baba') (#34417)
GitOrigin-RevId: 27d3d7a15458f8e6ff33e3540c14f341f44efc80
1 parent 64fd422 commit 1fe1b23

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

crates/common/src/testing/persistence_test_suite.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ pub async fn write_and_load_value_types<P: Persistence>(p: Arc<P>) -> anyhow::Re
522522
ConvexValue::String("\u{10348}".try_into()?),
523523
ConvexValue::Bytes(vec![].try_into()?),
524524
ConvexValue::Bytes(vec![3, 3, 4, 4].try_into()?),
525+
ConvexValue::Bytes(vec![0; (1 << 25) - 10000].try_into()?),
525526
ConvexValue::Array(vec![ConvexValue::Null].try_into()?),
526527
ConvexValue::Set(btreeset!(ConvexValue::Null).try_into()?),
527528
ConvexValue::Map(btreemap!(ConvexValue::Null => ConvexValue::Null).try_into()?),

crates/mysql/src/connection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ fn format_mysql_text_protocol(
173173
.into_iter()
174174
.map(|p| match p {
175175
MySqlValue::NULL => "NULL".to_owned(),
176-
MySqlValue::Bytes(bytes) => format!("unhex('{}')", hex::encode(bytes)),
176+
MySqlValue::Bytes(bytes) => format!("x'{}'", hex::encode(bytes)),
177177
MySqlValue::Int(i) => format!("{i}"),
178178
MySqlValue::UInt(u) => format!("{u}"),
179179
// We don't use the following and I don't want to deal with escaping them.
@@ -556,7 +556,7 @@ mod tests {
556556
encoded,
557557
r#"
558558
SELECT * FROM presley_db.indexes
559-
WHERE (key, value) IN (-27, unhex('2178613f29'))
559+
WHERE (key, value) IN (-27, x'2178613f29')
560560
AND deleted IS NULL",
561561
"#,
562562
);

0 commit comments

Comments
 (0)