1
0

Accepting request 1156328 from home:dspinella:branches:server:database

- Fix build with gcc14, bsc#1221007
  * fix-build-gcc14.patch

OBS-URL: https://build.opensuse.org/request/show/1156328
OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb-connector-c?expand=0&rev=96
This commit is contained in:
Danilo Spinella 2024-03-08 10:51:38 +00:00 committed by Git OBS Bridge
parent 56a6ec784d
commit 5b51c661dc
3 changed files with 53 additions and 0 deletions

46
fix-build-gcc14.patch Normal file
View File

@ -0,0 +1,46 @@
diff --git a/plugins/io/remote_io.c b/plugins/io/remote_io.c
index c06ecac..3deb144 100644
--- a/plugins/io/remote_io.c
+++ b/plugins/io/remote_io.c
@@ -279,11 +279,11 @@ MA_FILE *ma_rio_open(const char *url,const char *operation)
MA_REMOTE_FILE *rf;
(void)operation;
- if (!(file = (MA_FILE *)calloc(sizeof(MA_FILE), 1)))
+ if (!(file = (MA_FILE *)calloc(sizeof(MA_FILE) + 0, 1)))
return NULL;
file->type= MA_FILE_REMOTE;
- if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(sizeof(MA_REMOTE_FILE), 1)))
+ if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(sizeof(MA_REMOTE_FILE) + 0, 1)))
{
free(file);
return NULL;
diff --git a/unittest/libmariadb/bulk1.c b/unittest/libmariadb/bulk1.c
index e1c31ea..7450acb 100644
--- a/unittest/libmariadb/bulk1.c
+++ b/unittest/libmariadb/bulk1.c
@@ -74,8 +74,8 @@ static int bulk1(MYSQL *mysql)
/* allocate memory */
buffer= calloc(TEST_ARRAY_SIZE, sizeof(char *));
- lengths= (unsigned long *)calloc(sizeof(long), TEST_ARRAY_SIZE);
- vals= (unsigned int *)calloc(sizeof(int), TEST_ARRAY_SIZE);
+ lengths= (unsigned long *)calloc(sizeof(long) + 0, TEST_ARRAY_SIZE);
+ vals= (unsigned int *)calloc(sizeof(int) + 0, TEST_ARRAY_SIZE);
for (i=0; i < TEST_ARRAY_SIZE; i++)
{
diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c
index 804ef3e..39047df 100644
--- a/unittest/libmariadb/ps_bugs.c
+++ b/unittest/libmariadb/ps_bugs.c
@@ -5159,7 +5159,7 @@ static int test_maxparam(MYSQL *mysql)
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
MYSQL_BIND* bind;
- bind = calloc(sizeof(MYSQL_BIND), 65535);
+ bind = calloc(sizeof(MYSQL_BIND) + 0, 65535);
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
check_mysql_rc(rc, mysql);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 8 10:49:30 UTC 2024 - Danilo Spinella <danilo.spinella@suse.com>
- Fix build with gcc14, bsc#1221007
* fix-build-gcc14.patch
-------------------------------------------------------------------
Fri Feb 23 11:16:54 UTC 2024 - pgajdos@suse.com

View File

@ -38,6 +38,7 @@ Source2: mariadb.keyring
Source3: baselibs.conf
Patch1: mariadb-connector-c-2.3.1_unresolved_symbols.patch
Patch4: private_library.patch
Patch5: fix-build-gcc14.patch
BuildRequires: cmake
BuildRequires: curl-devel
BuildRequires: pkgconfig