mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Code cleanup
client/mysql.cc: Don't call mysql_close() on not initialized object sql/field.cc: code cleanup
This commit is contained in:
parent
fd3235dcd3
commit
6b1e06e620
2 changed files with 6 additions and 3 deletions
|
@ -2228,8 +2228,11 @@ static int
|
||||||
sql_real_connect(char *host,char *database,char *user,char *password,
|
sql_real_connect(char *host,char *database,char *user,char *password,
|
||||||
uint silent)
|
uint silent)
|
||||||
{
|
{
|
||||||
mysql_close(&mysql);
|
if (connected)
|
||||||
|
{
|
||||||
connected= 0;
|
connected= 0;
|
||||||
|
mysql_close(&mysql);
|
||||||
|
}
|
||||||
mysql_init(&mysql);
|
mysql_init(&mysql);
|
||||||
if (opt_connect_timeout)
|
if (opt_connect_timeout)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4721,7 +4721,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
|
||||||
{
|
{
|
||||||
uint tmp=(uint) Field_enum::val_int();
|
uint tmp=(uint) Field_enum::val_int();
|
||||||
if (!tmp || tmp > typelib->count)
|
if (!tmp || tmp > typelib->count)
|
||||||
val_ptr->set((const char*)"",0);
|
val_ptr->set("",0);
|
||||||
else
|
else
|
||||||
val_ptr->set((const char*) typelib->type_names[tmp-1],
|
val_ptr->set((const char*) typelib->type_names[tmp-1],
|
||||||
(uint) strlen(typelib->type_names[tmp-1]));
|
(uint) strlen(typelib->type_names[tmp-1]));
|
||||||
|
|
Loading…
Add table
Reference in a new issue