summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-06-06 00:07:27 +0200
committerSergei Golubchik <sergii@pisem.net>2014-06-06 00:07:27 +0200
commite27c338634739ef56a6888e7948e04c0fa0ba677 (patch)
treead63ccae614f3dd77509825d1905fd815ef322cb /libmysql
parent2a5905141a3c509a7c34c3d370fb146dbc1c965f (diff)
parent6d75570e99fbf070cdbeefdfbcfc94d1c7b3ad1f (diff)
downloadmariadb-git-e27c338634739ef56a6888e7948e04c0fa0ba677.tar.gz
5.5.38 merge
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/CMakeLists.txt1
-rw-r--r--libmysql/errmsg.c4
-rw-r--r--libmysql/libmysql.c8
3 files changed, 10 insertions, 3 deletions
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 9ed89c5e081..6897031b1f9 100644
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -138,6 +138,7 @@ my_print_help
)
SET(CLIENT_API_FUNCTIONS_5_5
+my_progname
mysql_stmt_next_result
# Charsets
my_charset_bin
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 0517be9bdee..84884f9565a 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
@@ -107,6 +107,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 3d8a2bebc75..554c3fc0ab6 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, SkySQL 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
@@ -1340,6 +1340,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));
}