Branch: Tag:

2016-01-07

2016-01-07 15:22:59 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Mysql: Report the error cause on db selection failure.

Fixes [bug 1562].

605:    MYSQL_DISALLOW();       if (tmp) { +  const char *err; +  err = mysql_error(mysql); +     if (strlen(database) < 1024) { -  Pike_error("Mysql.mysql(): Couldn't select database \"%s\"\n", database); +  Pike_error("Mysql.mysql(): Couldn't select database \"%s\": %s\n", +  database, err);    } else { -  Pike_error("Mysql.mysql(): Couldn't select database\n"); +  Pike_error("Mysql.mysql(): Couldn't select database: %s\n", err);    }    }    }