我正在发送 COM_EXECUTE_STMT 消息,服务器总是返回:
错误 1048 - #23000 - 列“number_tinyint”不能为空
查询是这样的:
insert into numbers (
number_tinyint,
number_smallint,
number_mediumint,
number_int,
number_bigint,
number_decimal,
number_float,
number_double
) values
(
?, 679, 778, 875468, 100007654, 198.657809, 432.8, ?)
我发送的是:
0: 18 00 00 00 17 01 00 00 . . . . . . . .
1: 00 00 01 00 00 00 00 00 . . . . . . . .
2: 01 01 05 0a 29 5c 8f c2 . . . . ) \ . .
3: f5 b0 58 40 . . X @
并简化阅读:
18 00 00 - size
00 - sequence
17 - type
01 00 00 00 - statement id
00 - flags
01 00 00 00 - iteration-count
00 00 - null bitmap
01 - new params bound flag
01 - byte type
05 - double type
0a - byte value - 10
29 5c 8f c2 f5 b0 58 40 - double value
语句参数是 10(对于 tinyint 列)和 98.765(对于 double 列)。从我可以看到消息被正确编码,但由于某种原因它总是失败(至少从文档中说)
我在这里错过了什么吗?