What is the reason why await is waiting for a return, not promise?

await did not wait for promise to come back

async function getDataFromDB(type,sql,connect_handler,data=[]){
    return new Promise(function(resolve,reject){
        if(type == "mysql"){
            if(data.length == 0){
                let t = connect_handler.query(sql,function(err,result,fields){
                    if(err){
                        //console.log(err);
                        reject(err);
                    }else{
                        //console.log(results);
                        // Promise.resolve(results);
                        resolve(result);
                    }
                })

                
            }else{
                connect_handler.query(sql,data,function(err,result,fields){
                    if(err){
                        //console.log(err);
                        reject(err);    
                    }else{
                        
                        resolve(result);
                    }
                })
            }
        
        }else if(type == "oracledb"){
            if(data.length == 0){
                connect_handler.execute(sql,function(err,result){
                    if(err){
                        //console.log(err);
                        reject(err);
                    }else{
                        resolve(result);
                    }
                })
            }else{
                connect_handler.execute(sql,data,function(err,result){
                    if(err){
                        //console.log(err);
                        reject(err);
                    }else{
                        //console.log(result);
                        resolve(result);
                    }
                })
            }
            
        }else{
            console.error("mysqloracledb");
        }
    })
    
}
    
    connection.then(async function([oracle_connect,mysql_connect]){
        console.log("");
    
        let studentNoSet = await getDataFromDB("mysql",`select distinct stu_no from stu_detail`,mysql_connect);
        **console.log(studentNoSet);   //  promise** 
        /*studentNoSet.then(function(data){
            console.log(data);
            console.log("");
            process.exit(1);
        }).catch(function(err){
            console.log(err);
        });*/
    });
Mar.10,2021

getDataFromDB("mysql",`select distinct stu_no from stu_detail`,mysql_connect)

this returns promise

await this promise gets getDataFromDB as the return value of an ordinary function

.

but console.log comes out as undefined

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-1b3b33d-2c269.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-1b3b33d-2c269.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?