zoukankan      html  css  js  c++  java
  • datagrip bug 小记

    datagrip bug 小记

    今天遇到了一个小bug,datagrip 2020.1出现

    [S1000] Attempt to close streaming result set com.mysql.cj.protocol.a.result.ResultsetRowsStreaming@42b0babe that was not registered.
    Only one streaming result set may be open and in use per-connection. Ensure that you have called .close() on any active result sets before attempting more queries.

    查了一下,这是个jet brains 全家桶里都有的bug。 bug

    怎么复现

    非常简单: 在存储过程里然后个循环,然后循环里执行select 查询,然后将结果赋值给另一个变量,call自定义函数。

    CREATE PROCEDURE test_loop()
    BEGIN
        declare p1 bigint;
        declare total bigint;
        declare current varchar(100);
        set p1 = 0;
        select count(*) into total from A_table;
    
        label1: 
        LOOP
            IF p1 >= total THEN
                leave label1;
            END IF;
    
            select id into current from A_table order by id limit 1 offset p1;
    
            select test_func(current);
    
            SET p1 = p1 + 1;
            ITERATE label1;
        END LOOP label1;
        SET @x = p1;
    END;
    
    -- table 
    
    create table A_table
    (
        id   varchar(100),
        create_time datetime default CURRENT_TIMESTAMP,
        index idx_id (id)
    );
    
    -- function
    
    create
        definer = root@`%` function test_func(id varchar(50)) returns varchar(50)
    begin
        return id;
    end;
    
    

    如何修复

    这里我用的是mysql 5.7 所以一下方案只对mysql 5.7 管用:

    更改mysql的驱动,默认选中的是mysql, 要手动改为mysql 5.1

  • 相关阅读:
    算法图解-散列表
    算法图解-笔记
    ERROR:cannot read property 'getAttribute' of null 报错处理
    Error: Cannot find module 'node-sass' 报错处理
    一、Spring Cloud概述
    十、ActiveMQ多节点集群
    九、ActiveMQ的消息存储和持久化
    八、ActiveMQ的传输协议
    七、SpringBoot整合ActiveMQ
    六、Spring整合ActiveMQ
  • 原文地址:https://www.cnblogs.com/qulianqing/p/13267771.html
Copyright © 2011-2022 走看看