gpt4 book ai didi

mysql - 如果其中一列的数据超过 1024 个字符,则不返回记录集 Mysql 8.0 和 Classic ASP

转载 作者:行者123 更新时间:2023-12-03 23:06:28 26 4
gpt4 key购买 nike

我正在使用 32 位 MySQL ODBC 连接器 8.19 和 Classic asp
MYSQL 服务器是 8。
CHARACTER 是 latin1 而 COLLATE 是 latin1_swedish_ci
连接字符串有 OPTION=3
存储引擎是 InnoDB

以下是表结构

CREATE TABLE Data_temp
(
ROWGUID varchar(36) default (UUID()) NOT NULL ,
col_desc varchar(10) NOT NULL ,
History varchar (4000),
PRIMARY KEY Data_temp_P_KEY(ROWGUID)
) ;

使用 Adodb 命令运行以下查询
Select * from Data_temp WHERE col_desc=?

参数由 adodb create 参数提供。

结果在 adodb 记录集中返回为
set recordset=command.execute method

如果 History 列的数据超过 1024 个字符,则不返回记录集

如果在以下场景中运行相同的查询
作为 ,
  • Select col_desc,Rowguid 
    from Data_temp
    WHERE col_desc=?

    即列列表不包含该大数据列然后返回记录集
  • Select col_desc,Rowguid,substring(history,1,1024) 
    from Data_temp
    WHERE col_desc=?

    也有效。
  • 通过将列设为 TEXT 数据类型而不是 varchar

  • 可能是什么原因?

    返回列数据有限制吗?
    如果查询直接使用查询本身的值运行,则另一种观察而不是使用参数化查询
    Select * from Data_temp WHERE Col_Desc='aa' 

    没有参数则返回记录集

    提前致谢

    最佳答案

    看看这些类似的问题:
    https://bugs.mysql.com/bug.php?id=92078
    https://bugs.mysql.com/bug.php?id=93895
    https://bugs.mysql.com/bug.php?id=94545
    以及官方推荐:

    Source: https://dev.mysql.com/doc/relnotes/connector-odbc/en/news-8-0-16.html

    An exception was emitted when fetching contents of a BLOB/TEXT records after executing a statement as a server-side prepared statement with a bound parameter.

    The workaround is not using parameters or specifying NO_SSPS=1 in the connection string; this allows the driver to fetch the data.

    In Connector/ODBC 5.2 and after, by default, server-side preparedstatements are used. When this option is set to a non-zero value,prepared statements are emulated on the client side, which is the samebehavior as in 5.1 and 3.51. Added in 5.2.0.


    推荐的解决方法是指定 NO_SSPS=1在连接字符串中,我确认它有效。

    关于mysql - 如果其中一列的数据超过 1024 个字符,则不返回记录集 Mysql 8.0 和 Classic ASP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62372780/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com