Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 692672

Summary: gnome-extra/libgda-5.2.8-r1 USE="mysql" fails with dev-db/mysql-connector-c-8.0.17-r1: gda-mysql-provider.c:1838:2: error: unknown type name ‘my_bool’
Product: Gentoo Linux Reporter: Attila Tóth <atoth>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: normal CC: fkrogh, kripton, leonchik1976, mysql-bugs, o.freyermuth, phobosk
Priority: Normal Keywords: PATCH, PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gitlab.gnome.org/GNOME/libgda/-/issues/199
See Also: https://github.com/gentoo/gentoo/pull/15398
https://github.com/gentoo/gentoo/pull/22367
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 692570    
Attachments: libgda-5.2.8-my_bool-error.diff
build.log.xz

Description Attila Tóth 2019-08-21 12:07:19 UTC
gda-mysql-provider.c: In function ‘real_prepare’:
gda-mysql-provider.c:1838:2: error: unknown type name ‘my_bool’; did you mean ‘bool’?
 1838 |  my_bool update_max_length = 1;
      |  ^~~~~~~
      |  bool
gda-mysql-provider.c: In function ‘prepare_stmt_simple’:
gda-mysql-provider.c:1944:2: error: unknown type name ‘my_bool’; did you mean ‘bool’?
 1944 |  my_bool update_max_length = 1;
      |  ^~~~~~~
      |  bool
gda-mysql-provider.c: In function ‘gda_mysql_provider_statement_execute’:
gda-mysql-provider.c:2330:36: error: ‘my_bool’ undeclared (first use in this function); did you mean ‘bool’?
 2330 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                    ^~~~~~~
      |                                    bool
gda-mysql-provider.c:2330:36: note: each undeclared identifier is reported only once for each function it appears in
gda-mysql-provider.c:2330:44: error: expected expression before ‘)’ token
 2330 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-provider.c:2350:44: error: expected expression before ‘)’ token
 2350 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-provider.c:2402:44: error: expected expression before ‘)’ token
 2402 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-provider.c:2462:44: error: expected expression before ‘)’ token
 2462 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-provider.c:2498:44: error: expected expression before ‘)’ token
 2498 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-provider.c:2531:44: error: expected expression before ‘)’ token
 2531 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-provider.c:2551:44: error: expected expression before ‘)’ token
 2551 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-provider.c:2627:44: error: expected expression before ‘)’ token
 2627 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-recordset.c: In function ‘gda_mysql_recordset_new’:
gda-mysql-recordset.c:630:53: error: ‘my_bool’ undeclared (first use in this function); did you mean ‘bool’?
  630 |   mysql_bind_result[i].is_null = g_malloc0 (sizeof (my_bool));
      |                                                     ^~~~~~~
      |                                                     bool
gda-mysql-recordset.c:630:53: note: each undeclared identifier is reported only once for each function it appears in
gda-mysql-provider.c:2668:44: error: expected expression before ‘)’ token
 2668 |     mysql_bind_param[i].is_null = (my_bool*)1;
      |                                            ^
gda-mysql-recordset.c: In function ‘new_row_from_mysql_stmt’:
gda-mysql-recordset.c:756:4: error: unknown type name ‘my_bool’; did you mean ‘bool’?
  756 |    my_bool truncated;
      |    ^~~~~~~
      |    bool
gda-mysql-recordset.c:757:33: warning: assignment to ‘_Bool *’ from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
  757 |    mysql_bind_result[col].error = &truncated;
      |                                 ^
gda-mysql-recordset.c:787:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
  787 |   my_bool is_null = FALSE;
      |   ^~~~~~~
      |   bool
gda-mysql-recordset.c:790:60: error: ‘my_bool’ undeclared (first use in this function); did you mean ‘bool’?
  790 |   memmove (&is_null, mysql_bind_result[i].is_null, sizeof (my_bool));
      |                                                            ^~~~~~~
Comment 1 Attila Tóth 2019-08-21 12:08:07 UTC
This bug is related to the recent mysql-8 & mysql-connector-c-8 version bump.
Candidate for tracker:
https://bugs.gentoo.org/692570
Comment 2 Attila Tóth 2019-08-21 12:09:12 UTC
Created attachment 587742 [details, diff]
libgda-5.2.8-my_bool-error.diff

Proposed patch to make it compile with the recent version of mysql-connector-c.
Comment 3 Fred Krogh 2019-09-10 20:30:17 UTC
Patch works for me.
Comment 4 Marc van der Sluys 2020-02-24 09:49:48 UTC
Same issue here still after six months (for the stable version of gnome-extra/libgda!), and the patch solves this - thanks!

I added an ebuild for libgda-5.2.8-r2 using the patch to my private Gentoo repository: https://cgit.gentoo.org/user/AstroFloyd.git/tree/gnome-extra/libgda - should this or something similar be in Portage for a simpler workaround (unmasking rather than patching manually)?
Comment 5 Kelly Black 2020-02-24 16:16:42 UTC
I had the same issue. The patch fixed it for me as well. Thank you!
Comment 6 hangglider 2020-08-12 09:10:36 UTC
Same here. Patch maybe fixed it - I simply added line

typedef bool my_bool;

to providers/mysql/gda-mysql.h, as I noticed mysql uses 'bool' too.
Comment 7 Eric 2020-09-05 14:17:35 UTC
(In reply to Kelly Black from comment #5)
> I had the same issue. The patch fixed it for me as well. Thank you!

how do you use the patch please?
Comment 8 Attila Tóth 2020-09-05 16:42:46 UTC
(In reply to Eric from comment #7)
> (In reply to Kelly Black from comment #5)
> > I had the same issue. The patch fixed it for me as well. Thank you!
> 
> how do you use the patch please?

1. Create directory:
/etc/portage/patches/gnome-extra/libgda-5.2.8
2. Copy/save the patch in that directory
3. Re-emerge libgda
Note, that if a solution gets into portage, you may need to delete or disable the patch by renaming it to make the package compile.
Comment 9 PhobosK 2020-09-20 14:34:06 UTC
Same problem with gnome-extra/libgda-5.2.9
The patch works there also (actually it is a generic one for all 5.2.X versions)...
Shame it is still not implemented in portage for both versions
Comment 10 Leonid Kopylov 2021-02-19 17:00:52 UTC
After applying the patch, i still can't compile it
Comment 11 Leonid Kopylov 2021-02-19 17:01:39 UTC
Created attachment 687615 [details]
build.log.xz
Comment 12 Larry the Git Cow gentoo-dev 2021-09-25 02:50:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a2c12ba5c70d6887856c59e6c1b4e2633f9a441

commit 1a2c12ba5c70d6887856c59e6c1b4e2633f9a441
Author:     shimataro <shimataro@zelkova.cc>
AuthorDate: 2021-09-22 21:19:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-09-25 02:45:57 +0000

    gnome-extra/libgda: fix build with newer MySQL
    
    Thanks-to: Attila Tóth <atoth@atoth.sote.hu>
    Closes: https://bugs.gentoo.org/692672
    Signed-off-by: shimataro <shimataro@zelkova.cc>
    Closes: https://github.com/gentoo/gentoo/pull/22367
    Signed-off-by: Sam James <sam@gentoo.org>

 .../libgda/files/libgda-5.2-my_bool-error.patch    | 136 +++++++++++++++++++++
 gnome-extra/libgda/libgda-5.2.9.ebuild             |   3 +
 2 files changed, 139 insertions(+)