MariaDB預存程序異常訊息:意外的流結束,讀取0位元組時發生錯誤
<p>我們在MariaDB中有一個預存程序,在伺服器上運行良好,但是當我們使用JDBC從客戶端運行時,我們可以獲取到前幾行,但是後面總是出現以下錯誤:</p> ;
<pre class="brush:php;toolbar:false;">unexpected end of stream, read 0 bytes from 4 (socket was closed by server)</pre>
<p>表格<code>loan_balances2</code>不太,大約有600K行。這是儲存過程,你看到有什麼問題嗎?謝謝! </p>
<pre class="brush:php;toolbar:false;">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</pre></p>