Skip to content

Commit dad72b6

Browse files
committed
Merge branch '3.3' into 3.4
2 parents 0eb34a2 + c58dce9 commit dad72b6

File tree

8 files changed

+21
-26
lines changed

8 files changed

+21
-26
lines changed

libmariadb/get_password.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ char* get_tty_password(char *prompt, char *buffer, int length)
122122
if (prompt)
123123
fprintf(stderr, "%s", prompt);
124124

125-
if (!(Hdl= CreateFile("CONIN$",
126-
GENERIC_READ | GENERIC_WRITE,
127-
FILE_SHARE_READ,
128-
NULL,
129-
OPEN_EXISTING, 0, NULL)))
125+
if ((Hdl= CreateFile("CONIN$",
126+
GENERIC_READ | GENERIC_WRITE,
127+
FILE_SHARE_READ,
128+
NULL,
129+
OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
130130
{
131131
/* todo: provide a graphical dialog */
132132
return buffer;

libmariadb/ma_io.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,9 @@ int ma_feof(MA_FILE *file)
165165
switch (file->type) {
166166
case MA_FILE_LOCAL:
167167
return feof((FILE *)file->ptr);
168-
break;
169168
#ifdef HAVE_REMOTEIO
170169
case MA_FILE_REMOTE:
171170
return rio_plugin->methods->mfeof(file);
172-
break;
173171
#endif
174172
default:
175173
return -1;
@@ -188,11 +186,9 @@ size_t ma_read(void *ptr, size_t size, size_t nmemb, MA_FILE *file)
188186
case MA_FILE_LOCAL:
189187
s= fread(ptr, size, nmemb, (FILE *)file->ptr);
190188
return s;
191-
break;
192189
#ifdef HAVE_REMOTEIO
193190
case MA_FILE_REMOTE:
194191
return rio_plugin->methods->mread(ptr, size, nmemb, file);
195-
break;
196192
#endif
197193
default:
198194
return -1;
@@ -209,11 +205,9 @@ char *ma_gets(char *ptr, size_t size, MA_FILE *file)
209205
switch (file->type) {
210206
case MA_FILE_LOCAL:
211207
return fgets(ptr, (int)size, (FILE *)file->ptr);
212-
break;
213208
#ifdef HAVE_REMOTEIO
214209
case MA_FILE_REMOTE:
215210
return rio_plugin->methods->mgets(ptr, size, file);
216-
break;
217211
#endif
218212
default:
219213
return NULL;

libmariadb/ma_stmt_codec.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ static void convert_froma_string(MYSQL_BIND *r_param, char *buffer, size_t len)
571571
str_to_TIME(buffer, len, tm);
572572
break;
573573
}
574-
break;
575574
case MYSQL_TYPE_TINY_BLOB:
576575
case MYSQL_TYPE_MEDIUM_BLOB:
577576
case MYSQL_TYPE_LONG_BLOB:

libmariadb/ma_time.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ size_t mariadb_time_to_string(const MYSQL_TIME *tm, char *time_str, size_t len,
5252
default:
5353
time_str[0]= '\0';
5454
return 0;
55-
break;
5655
}
5756
if (digits && len > length + 1)
5857
length+= snprintf(time_str + length, len - length, ".%0*lu", digits,

libmariadb/mariadb_lib.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,6 @@ my_bool _mariadb_set_conf_option(MYSQL *mysql, const char *config_option, const
820820
switch (mariadb_defaults[i].type) {
821821
case MARIADB_OPTION_FUNC:
822822
return mariadb_defaults[i].u.option_func(mysql, config_option, config_value, -1);
823-
break;
824823
case MARIADB_OPTION_BOOL:
825824
val_bool= 0;
826825
if (config_value)
@@ -939,7 +938,6 @@ static int parse_connection_string(MYSQL *mysql, const char *unused __attribute_
939938
if (pos <= end)
940939
val= pos;
941940
continue;
942-
break;
943941
case ';':
944942
if (in_curly_brace)
945943
{
@@ -953,7 +951,6 @@ static int parse_connection_string(MYSQL *mysql, const char *unused __attribute_
953951
_mariadb_set_conf_option(mysql, key, val);
954952
key= val= NULL;
955953
continue;
956-
break;
957954
}
958955
if (!key && *pos)
959956
key= pos;
@@ -1367,7 +1364,11 @@ mysql_init(MYSQL *mysql)
13671364
return mysql;
13681365
error:
13691366
if (mysql->free_me)
1367+
{
1368+
if (mysql->net.extension)
1369+
free(mysql->net.extension);
13701370
free(mysql);
1371+
}
13711372
return 0;
13721373
}
13731374

@@ -2122,7 +2123,14 @@ my_bool STDCALL mariadb_reconnect(MYSQL *mysql)
21222123
return(1);
21232124
}
21242125

2125-
mysql_init(&tmp_mysql);
2126+
if (!mysql_init(&tmp_mysql))
2127+
{
2128+
/* extensions may have failed to allocate */
2129+
SET_CLIENT_ERROR(mysql, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
2130+
tmp_mysql.free_me= 0;
2131+
mysql_close(&tmp_mysql);
2132+
return(1);
2133+
}
21262134
tmp_mysql.free_me= 0;
21272135
tmp_mysql.options=mysql->options;
21282136
if (mysql->extension->conn_hdlr)

libmariadb/mariadb_rpl.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ void rpl_set_error(MARIADB_RPL *rpl,
119119

120120
const char *errmsg;
121121

122-
return;
123122
if (!format)
124123
{
125124
if (error_nr >= CR_MIN_ERROR && error_nr <= CR_MYSQL_LAST_ERROR)
@@ -1166,8 +1165,6 @@ MARIADB_RPL_EVENT * STDCALL mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVEN
11661165
case UNKNOWN_EVENT:
11671166
case SLAVE_EVENT:
11681167
return rpl_event;
1169-
break;
1170-
11711168
case HEARTBEAT_LOG_EVENT:
11721169
len= rpl_event->event_length - (ev - ev_start) - (rpl->use_checksum ? 4 : 0) - (EVENT_HEADER_OFS - 1);
11731170
RPL_CHECK_POS(ev, ev_end, len);
@@ -1893,7 +1890,6 @@ MARIADB_RPL_EVENT * STDCALL mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVEN
18931890
return 0;
18941891
}
18951892
return rpl_event;
1896-
break;
18971893
}
18981894

18991895
/* check if we have to send acknowledgement to primary
@@ -2087,7 +2083,6 @@ int STDCALL mariadb_rpl_get_optionsv(MARIADB_RPL *rpl,
20872083
default:
20882084
va_end(ap);
20892085
return 1;
2090-
break;
20912086
}
20922087
va_end(ap);
20932088
return 0;

libmariadb/mariadb_stmt.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,8 @@ my_bool mthd_supported_buffer_type(enum enum_field_types type)
175175
case MYSQL_TYPE_VAR_STRING:
176176
case MYSQL_TYPE_YEAR:
177177
return 1;
178-
break;
179178
default:
180179
return 0;
181-
break;
182180
}
183181
}
184182

@@ -1378,7 +1376,6 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *bind)
13781376
default:
13791377
stmt_set_error(stmt, CR_UNSUPPORTED_PARAM_TYPE, SQLSTATE_UNKNOWN, 0);
13801378
return(1);
1381-
break;
13821379
}
13831380
}
13841381
}

plugins/auth/caching_sha2_pw.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,10 @@ static int auth_caching_sha2_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
363363

364364
#endif
365365
if (!pubkey)
366-
return CR_ERROR;
366+
{
367+
rc= CR_ERROR;
368+
goto error;
369+
}
367370

368371
pwlen= (unsigned int)strlen(mysql->passwd) + 1; /* include terminating zero */
369372
if (pwlen > MAX_PW_LEN)

0 commit comments

Comments
 (0)