unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 02017e324d4953e0a7cb072e43763585979d11c2 1255 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
From 93efa48a7b972fc463406603574a4d508eefe792 Mon Sep 17 00:00:00 2001
From: Sergei Golubchik <serg@mariadb.org>
Date: Sun, 13 May 2018 18:50:21 +0200
Subject: [PATCH] fix failing main.mysql_client_test test on 32bit

in `ulonglong=ulong*uint` multiplication
is done in ulong, wrapping around on 32bit.

This became visible after C/C changed the
default charset to utf8, thus changing
mbmaxlem from 1 to 3.
---
 tests/mysql_client_fw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c
index f69eb28a2871..4d036887629a 100644
--- a/tests/mysql_client_fw.c
+++ b/tests/mysql_client_fw.c
@@ -768,7 +768,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
 {
   MYSQL_FIELD *field;
   CHARSET_INFO *cs;
-  ulonglong expected_field_length;
+  ulonglong expected_field_length= length;
 
   if (!(field= mysql_fetch_field_direct(result, no)))
   {
@@ -777,7 +777,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
   }
   cs= get_charset(field->charsetnr, 0);
   DIE_UNLESS(cs);
-  if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32)
+  if ((expected_field_length*= cs->mbmaxlen) > UINT_MAX32)
     expected_field_length= UINT_MAX32;
   if (!opt_silent)
   {

debug log:

solving 02017e324d ...
found 02017e324d in https://git.savannah.gnu.org/cgit/guix.git

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).