我们在MariaDB中有一个存储过程,在服务器上运行良好,但是当我们使用JDBC从客户端运行时,我们可以获取到前几行,但是后面总是出现以下错误:
unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
表loan_balances2不是太大,大约有600K行。这是存储过程,你看到有什么问题吗?谢谢!
CREATE PROCEDURE `get_loan_balances_sample`() BEGIN drop table if exists all_loan_ids; drop table if exists random_loan_ids; create table all_loan_ids as select distinct loan_id from loan_balances2; create table random_loan_ids as select * from all_loan_ids order by RAND() limit 50; SELECT * FROM loan_balances2 where loan_id in (select Loan_ID from random_loan_ids) order by Loan_ID, balance_date; END
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
通常是net_write_timeout。如果您的应用程序无法以服务器写入速度读取数据,服务器将关闭套接字。net_write_timeout是服务器尝试发送结果集的时间限制,以秒为单位。您可以增加该限制,这是一个会话变量。这也出现在MariaDB JDBC的常见问题解答中。