Closed devrimgunduz closed 3 years ago
Thanks @devrimgunduz for reporting this. Can you please confirm if the attached patch resolves those warnings and regression is fine after that at your end?
Hi,
I'm seeing one less warning only:
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I/usr/include/mysql -I/usr/include/mysql/mysql -D _MYSQL_LIBNAME=\"libmysqlclient.so\" -I. -I./ -I/usr/pgsql-12/include/server -I/usr/pgsql-12/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o mysql_fdw.bc mysql_fdw.c
mysql_query.c: In function 'mysql_bind_sql_var':
mysql_query.c:185:24: warning: assignment to 'my_bool *' {aka 'char *'} from incompatible pointer type '_Bool *' [-Wincompatible-pointer-types]
185 | binds[attnum].is_null = isnull;
| ^
mysql_query.c: In function 'mysql_bind_result':
mysql_query.c:401:17: warning: assignment to 'my_bool *' {aka 'char *'} from incompatible pointer type '_Bool *' [-Wincompatible-pointer-types]
401 | mbind->is_null = &column->is_null;
| ^
mysql_query.c:402:15: warning: assignment to 'my_bool *' {aka 'char *'} from incompatible pointer type '_Bool *' [-Wincompatible-pointer-types]
402 | mbind->error = &column->error;
| ^
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -shared -o mysql_fdw.so connection.o option.o deparse.o mysql_query.o mysql_fdw.o -L/usr/pgsql-12/lib -L/usr/lib64 -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-12/lib',--enable-new-dtags
mysql_query.c:185:24: warning: incompatible pointer types assigning to 'my_bool *' (aka 'char *') from 'bool *' [-Wincompatible-pointer-types]
binds[attnum].is_null = isnull;
^ ~~~~~~
mysql_query.c:401:17: warning: incompatible pointer types assigning to 'my_bool *' (aka 'char *') from 'bool *' [-Wincompatible-pointer-types]
mbind->is_null = &column->is_null;
^ ~~~~~~~~~~~~~~~~
mysql_query.c:402:15: warning: incompatible pointer types assigning to 'my_bool *' (aka 'char *') from 'bool *' [-Wincompatible-pointer-types]
mbind->error = &column->error;
^ ~~~~~~~~~~~~~~
3 warnings generated.
The VERSION ID is different for mysql and mariadb servers, that is why an earlier patch was not working for mariadb.
I have now fixed for MariaDB versions as well, can you please verify the same with the attached patch? I have tested at my end with MariaDB 10.5 on CentOS 7 and did not observe the above mentioned warnings, also regression is fine.
Hi @surajkharage19 ,
Thanks a lot! It worked.
Regards, Devrim
Hi,
I'm seeing these warnings on Fedora 32 (gcc 10.2.1 and mariadb-devel 10.4.13). Can you please take a look?
Thanks! Devrim