Menu

#2922 mysql-8 my_bool build fix

linux
closed
nobody
None
5
2019-04-15
2019-02-05
No

net-snmp fails to build with mysql-8 because, among other changes, mysql dropped the my_bool type.

Here is a patch:

--- a/apps/snmptrapd_sql.c
+++ b/apps/snmptrapd_sql.c
@@ -194,7 +198,7 @@
* static bind structures, plus 2 static buffers to bind to.
*/
static MYSQL_BIND _tbind[TBIND_MAX], _vbind[VBIND_MAX];
-static my_bool _no_v3;
+static int _no_v3;

static void _sql_process_queue(u_int dontcare, void *meeither);

Discussion

  • Bart Van Assche

    Bart Van Assche - 2019-02-06

    A slightly different patch has been applied on the v5.8 and master branches (https://sourceforge.net/p/net-snmp/code/ci/9f4af8c42d515e6b214738cc97212dfbe7f749cf/). Can you have a look?

     
  • Andreas Hasenack

    I guess you just want a byte? It's fine by me

     
  • Andreas Hasenack

    Did you really mean to assign the address of _no_v3 later on in the code?

    _tbind[TBIND_v3_SECURITY_ENGINE].is_null = &_no_v3;

     
    • Bart Van Assche

      Bart Van Assche - 2019-02-06

      Yes. From apps/snmptrapd_sql.c:

      static MYSQL_BIND _tbind[TBIND_MAX], _vbind[VBIND_MAX];
      

      From /usr/include/mysql/mysql.h:

      typedef char my_bool;
      

      From /usr/include/mysql/mariadb_stmt.h:

      typedef struct st_mysql_bind
      {
        [ .... ]
        /* set this if you want to track data truncations happened during fetch */
        my_bool        *is_null;
        [ .... ]
      } MYSQL_BIND;
      
       
  • Bart Van Assche

    Bart Van Assche - 2019-04-15
    • status: open --> closed
     

Log in to post a comment.