Commit 9f8aec7a authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Merge tag 'upstream/5.5.49' into ubuntu-14.04

Upstream version 5.5.49
parents 516ad142 d97fe3f6
......@@ -383,7 +383,8 @@ int decimal2string(const decimal_t *from, char *to, int *to_len,
}
else
frac-=j;
len= from->sign + intg_len + test(frac) + frac_len;
frac_len= frac;
len= from->sign + intg_len + test(frac) + frac;
}
*to_len=len;
s[len]=0;
......
......@@ -20,4 +20,4 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/unittest/mytap)
#
MY_ADD_TESTS(my_decimal EXT "cc" LINK_LIBRARIES mysys)
MY_ADD_TESTS(my_decimal EXT "cc" LINK_LIBRARIES strings dbug)
......@@ -61,12 +61,42 @@ test_copy_and_compare()
}
static int
test_decimal2string()
{
decimal_t d1;
decimal_digit_t buffer[DECIMAL_BUFF_LENGTH+2];
char *str_end;
const char strnum[]= "0.1234567890123456789012345678901234567890123467";
char strbuff[50];
int len= 40;
int i;
bzero(strbuff, sizeof(strbuff));
str_end= (char *)(strnum + (sizeof(strnum) - 1));
d1.len= DECIMAL_BUFF_LENGTH + 2;
d1.buf= buffer;
string2decimal(strnum, &d1, &str_end);
decimal2string(&d1, strbuff, &len, 0, 0, 'X');
/* last digit is not checked due to possible rounding */
for (i= 0; i < 38 && strbuff[i] == strnum[i]; i++);
ok(i == 38, "Number");
for (i= 39; i < 50 && strbuff[i] == 0; i++);
ok(i == 50, "No overrun");
return 0;
}
int main()
{
plan(13);
plan(15);
diag("Testing my_decimal constructor and assignment operators");
test_copy_and_compare();
test_decimal2string();
return exit_status();
}
......@@ -13,9 +13,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MY_ADD_TESTS(bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc
my_getopt
MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring
LINK_LIBRARIES mysys)
MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys)
IF(WIN32)
MY_ADD_TESTS(my_delete LINK_LIBRARIES mysys)
......
/* Copyright (c) 2016, MariaDB
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 the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
//#include <my_global.h>
#include <m_string.h>
#include <my_sys.h>
#include <tap.h>
DYNAMIC_STRING str1;
static void check(const char *res)
{
ok(strcmp(str1.str, res) == 0, "strcmp: %s", str1.str);
str1.length= 0;
}
int main(void)
{
plan(23);
IF_WIN(skip_all("Test of POSIX shell escaping rules, not for CMD.EXE\n"), );
ok(init_dynamic_string(&str1, NULL, 0, 32) == 0, "init");
ok(dynstr_append_os_quoted(&str1, "test1", NULL) == 0, "append");
check("'test1'");
ok(dynstr_append_os_quoted(&str1, "con", "cat", NULL) == 0, "append");
check("'concat'");
ok(dynstr_append_os_quoted(&str1, "", NULL) == 0, "append");
check("''");
ok(dynstr_append_os_quoted(&str1, "space inside", NULL) == 0, "append");
check("'space inside'");
ok(dynstr_append_os_quoted(&str1, "single'quote", NULL) == 0, "append");
check("'single'\"'\"'quote'");
ok(dynstr_append_os_quoted(&str1, "many'single'quotes", NULL) == 0, "append");
check("'many'\"'\"'single'\"'\"'quotes'");
ok(dynstr_append_os_quoted(&str1, "'single quoted'", NULL) == 0, "append");
check("''\"'\"'single quoted'\"'\"''");
ok(dynstr_append_os_quoted(&str1, "double\"quote", NULL) == 0, "append");
check("'double\"quote'");
ok(dynstr_append_os_quoted(&str1, "mixed\"single'and\"double'quotes", NULL) == 0, "append");
check("'mixed\"single'\"'\"'and\"double'\"'\"'quotes'");
ok(dynstr_append_os_quoted(&str1, "back\\space", NULL) == 0, "append");
check("'back\\space'");
ok(dynstr_append_os_quoted(&str1, "backspace\\'and\\\"quote", NULL) == 0, "append");
check("'backspace\\'\"'\"'and\\\"quote'");
dynstr_free(&str1);
return exit_status();
}
MY_ADD_TESTS(strings LINK_LIBRARIES strings)
MY_ADD_TESTS(strings LINK_LIBRARIES strings mysys)
......@@ -17,6 +17,10 @@
#include "vio_priv.h"
#ifdef HAVE_OPENSSL
#ifndef HAVE_YASSL
#include <openssl/dh.h>
#include <openssl/bn.h>
#endif
static my_bool ssl_algorithms_added = FALSE;
static my_bool ssl_error_strings_loaded= FALSE;
......
......@@ -17,35 +17,62 @@ IF(NOT WIN32)
RETURN()
ENDIF()
IF(MSVC_VERSION LESS 1600)
RETURN()
ENDIF()
SET(MANUFACTURER "MariaDB Corporation Ab")
FIND_PATH(WIX_DIR heat.exe
$ENV{WIX_DIR}/bin
$ENV{ProgramFiles}/wix/bin
"$ENV{ProgramFiles}/Windows Installer XML v3/bin"
"$ENV{ProgramFiles}/Windows Installer XML v3.5/bin"
"$ENV{ProgramFiles}/Windows Installer XML v3.6/bin"
"$ENV{WIX}/bin"
"$ENV{ProgramFiles}/WiX Toolset v3.9/bin"
"$ENV{ProgramFiles}/WiX Toolset v3.10/bin"
)
SET(CPACK_WIX_PACKAGE_BASE_NAME "MariaDB")
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
SET(CPACK_WIX_UPGRADE_CODE "49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3")
SET(CPACK_WIX_PACKAGE_NAME "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@")
SET(CPACK_WIX_PACKAGE_NAME "MariaDB ${MAJOR_VERSION}.${MINOR_VERSION}")
ELSE()
SET(CPACK_WIX_UPGRADE_CODE "2331E7BD-EE58-431B-9E18-B2B918BCEB1B")
SET(CPACK_WIX_PACKAGE_NAME "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@ (x64)")
SET(CPACK_WIX_PACKAGE_NAME "MariaDB ${MAJOR_VERSION}.${MINOR_VERSION} (x64)")
ENDIF()
IF(WIX_DIR)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(WIX_ARCH_SUFFIX "x64")
ELSE()
SET(WIX_ARCH_SUFFIX "x86")
ENDIF()
# Need some Wix SDK libraries to link with customaction
IF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 )
SET(WIX_MSVC_SUFFIX "VS2010")
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(WIX_MSVC_SUFFIX "VS2013")
ELSEIF (MSVC_VERSION EQUAL 1900)
SET(WIX_MSVC_SUFFIX "VS2015")
ENDIF()
FIND_LIBRARY(WIX_WCAUTIL_LIBRARY
NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
wcautil
PATHS
${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/lib/${WIX_ARCH_SUFFIX}
)
FIND_LIBRARY(WIX_DUTIL_LIBRARY
NAMES dutil${WIX_ARCH_SUFFIX}
dutil
PATHS
${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/lib/${WIX_ARCH_SUFFIX}
)
ENDIF()
IF(NOT WIX_DIR)
IF(NOT _WIX_DIR_CHECKED)
SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "")
MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated")
IF(BUILD_RELEASE)
IF(NOT WIX_DUTIL_LIBRARY)
MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated")
IF(BUILD_RELEASE)
MESSAGE(FATAL_ERROR
"Can't find Wix. It is necessary for producing official package"
)
ENDIF()
"Can't find Wix. It is necessary for producing official package")
ENDIF()
RETURN()
ENDIF()
......
......@@ -13,50 +13,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/inc)
LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib)
INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/inc)
SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(WIX_ARCH_SUFFIX "_x64")
SET(WIX36_ARCH_SUFFIX "x64")
ELSE()
SET(WIX_ARCH_SUFFIX)
SET(WIX36_ARCH_SUFFIX "x86")
ENDIF()
IF(MSVC_VERSION EQUAL 1400)
SET(WIX35_MSVC_SUFFIX "_2005")
ELSEIF(MSVC_VERSION EQUAL 1500)
SET(WIX35_MSVC_SUFFIX "_2008")
SET(WIX36_MSVC_SUFFIX "VS2008")
ELSEIF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 )
SET(WIX35_MSVC_SUFFIX "_2010")
SET(WIX36_MSVC_SUFFIX "VS2010")
ELSE()
# When next VS is out, add the correct version here
MESSAGE(FATAL_ERROR "Unknown VS version")
ENDIF()
INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/inc)
FIND_LIBRARY(WIX_WCAUTIL_LIBRARY
NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
wcautil
PATHS
${WIX_DIR}/../SDK/lib
${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX})
FIND_LIBRARY(WIX_DUTIL_LIBRARY
NAMES dutil${WIX_ARCH_SUFFIX} dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
dutil
PATHS
${WIX_DIR}/../SDK/lib
${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX}
)
ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})
TARGET_LINK_LIBRARIES(wixca ${WIX_WCAUTIL_LIBRARY} ${WIX_DUTIL_LIBRARY}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment