Node mysql request database return value error write after end

problem description

node accepts the request to query the database with a value and returns an error write after end

related codes

//    console.log(startTime,id,endTime)
var express = require("express");
var app = express();

var mysql = require("mysql");
var connection = mysql.createConnection({
    host: "127.0.0.1", // 
    user: "root", // 
    port : "3306",
    password: "", //
    database: "lbst" // 

});

connection.connect();
if(startTime != null) {
    //         var sql="select from lb_admin_addon where starTime= "+startTime+" and id="+ id +" and endTime="+endTime;
    //    select * from market_orders where createdate>="2010-03-01 00:00:00" and createdate<"2016-03-02 00:00:00"
    //         
    var sql = `
           SELECT * FROM lb_addmin_taglist WHERE timestamp>="${startTime}"  AND timestamp<"${endTime}"
       `
} else {
    var sql = "select * from lb_admin_msg";
}
var sqlarr = [];
connection.query(sql, function selectCB(err, results, fields) {
    if(err) {
        throw err;
    }
    if(results) {
        for(var a = 0; a < results.length; aPP) {
            sqlarr.push(results[a])
        }
    }
    connection.end();
})

function ztstInterval() {
    clearInterval(searchArr)
}
var num = 0;
var searchArr = setInterval(function() {
    numPP;
    console.log(sqlarr.length)
    if(sqlarr.length != 0) {
        ztstInterval();
        sqlarr = JSON.stringify(sqlarr)
        //               response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8"});
        var msg = {
            "": 200,
            data: sqlarr
        }
        response.write(1);
        response.end(msg);
    }
}, 1000)

May.13,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eac0b3-209a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eac0b3-209a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?