summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-06-03 09:55:08 +0200
committerSergei Golubchik <sergii@pisem.net>2014-06-03 09:55:08 +0200
commit5d16592d44d8dd7147ee868c661af842ec0f1568 (patch)
tree57f83c95bf23bdb90bd05e1134ffaaa0e015249f /libmysql
parent2d687cad5d1154418603a16e58772d91f37d4cbd (diff)
parentc1fd09f3d4848ae59605564ded9628307d59dd27 (diff)
downloadmariadb-git-5d16592d44d8dd7147ee868c661af842ec0f1568.tar.gz
mysql-5.5.38 merge
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/errmsg.c4
-rw-r--r--libmysql/libmysql.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 498ba6e9829..81d2728534a 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -105,6 +105,8 @@ const char** get_client_errmsgs()
void init_client_errs(void)
{
+ compile_time_assert(array_elements(client_errors) ==
+ (CR_ERROR_LAST - CR_ERROR_FIRST + 2));
(void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST);
}
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index e66a757424e..7a4fc9fabd4 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates
- Copyright (c) 2009, 2013, Monty Program Ab
+/* Copyright (c) 2000, 2014, Oracle and/or its affiliates
+ Copyright (c) 2009, 2014, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1339,6 +1339,10 @@ static my_bool my_realloc_str(NET *net, ulong length)
res= net_realloc(net, buf_length + length);
if (res)
{
+ if (net->last_errno == ER_OUT_OF_RESOURCES)
+ net->last_errno= CR_OUT_OF_MEMORY;
+ else if (net->last_errno == ER_NET_PACKET_TOO_LARGE)
+ net->last_errno= CR_NET_PACKET_TOO_LARGE;
strmov(net->sqlstate, unknown_sqlstate);
strmov(net->last_error, ER(net->last_errno));
}