mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-02 23:26:23 -07:00
Fixed empty query catch code
This commit is contained in:
parent
26782d05cf
commit
bb54b82630
1 changed files with 4 additions and 1 deletions
|
@ -104,8 +104,11 @@ func initDB(initFile string) error {
|
||||||
sqlArr := strings.Split(sqlReplacer.Replace(sqlStr), ";")
|
sqlArr := strings.Split(sqlReplacer.Replace(sqlStr), ";")
|
||||||
|
|
||||||
for _, statement := range sqlArr {
|
for _, statement := range sqlArr {
|
||||||
if statement != "" && statement != " " {
|
statement = strings.Trim(statement, " \n\r\t")
|
||||||
|
if len(statement) > 0 {
|
||||||
if _, err = db.Exec(statement); err != nil {
|
if _, err = db.Exec(statement); err != nil {
|
||||||
|
print(len(statement))
|
||||||
|
fmt.Printf("%08b", []byte(statement))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue