Bug #106899 MySQL-Workbench FTBFS with unixodbc 2.3.9
Submitted: 3 Apr 10:20 Modified: 23 Nov 4:21
Reporter: Dmitry Smirnov Email Updates:
Status: Analyzing Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:8.0.30 OS:Debian (unstable)
Assigned to: MySQL Verification Team CPU Architecture:x86

[3 Apr 10:20] Dmitry Smirnov
Description:
M-W FTBFS on amd64 with unixodbc 2.3.9:

```
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::end_select_table()': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:975: undefined reference to `SQLFreeHandle' 
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::~ODBCCopyDataSource()': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:679: undefined reference to `SQLFreeHandle' 
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:678: undefined reference to `SQLFreeHandle' 
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function ConnectionError::process[abi:cxx11](short] short, void*)': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:254: undefined reference to `SQLGetDiagRec' 
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::get_wchar_buffer_data(RowBuffer&, int)': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:694: undefined reference to `SQLGetData' 
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::get_date_time_data(RowBuffer&, int, int)': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:741: undefined reference to `SQLGetData' 
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::get_char_buffer_data(RowBuffer&, int)': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:767: undefined reference to `SQLGetData' 
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::get_geometry_buffer_data(RowBuffer&, int)': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:794: undefined reference to `SQLGetData' 
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::fetch_row(RowBuffer&)': 
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:982: undefined reference to `SQLFetch'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:1155: undefined reference to `SQLGetData'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:1117: undefined reference to `SQLGetData'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:1073: undefined reference to `SQLGetData'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:991: undefined reference to `SQLGetData'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:1027: undefined reference to `SQLGetData'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:1013: undefined reference to `SQLGetDiagRec'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:1091: undefined reference to `SQLGetData'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:1081: undefined reference to `SQLGetData'
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::count_rows(...)':
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:829: undefined reference to `SQLAllocHandle'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:866: undefined reference to `SQLExecDirect'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:870: undefined reference to `SQLFetch'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:871: undefined reference to `SQLGetData'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:873: undefined reference to `SQLFreeHandle'
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::ODBCCopyDataSource(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:656: undefined reference to `SQLAllocHandle'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:659: undefined reference to `SQLSetConnectAttr'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:667: undefined reference to `SQLDriverConnect'
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o: in function `ODBCCopyDataSource::begin_select_table(...)':
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:891: undefined reference to `SQLAllocHandle'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:914: undefined reference to `SQLExecDirect'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:918: undefined reference to `SQLNumResultCols'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:935: undefined reference to `SQLDescribeCol'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:942: undefined reference to `SQLColAttribute'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/copytable.cpp:945: undefined reference to `SQLColAttribute'
/usr/bin/ld: CMakeFiles/wbcopytables-bin.dir/copytable/main.cpp.o: in function `main':
./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/main.cpp:877: undefined reference to `SQLAllocHandle'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/main.cpp:878: undefined reference to `SQLSetEnvAttr'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/main.cpp:820: undefined reference to `SQLAllocHandle'
/usr/bin/ld: ./obj-x86_64-linux-gnu/plugins/migration/./plugins/migration/copytable/main.cpp:821: undefined reference to `SQLSetEnvAttr'
collect2: error: ld returned 1 exit status
make[4] *** [plugins/migration/CMakeFiles/wbcopytables-bin.dir/build.make:163: plugins/migration/wbcopytables-bin] Error 1
```

(Compilation succeeds with an older version of UnixODBS 2.3.6).

How to repeat:
Build in Debian "unstable".
[5 May 5:50] Dmitry Smirnov
Still a problem on 8.0.29. Please prioritise.

FYI this problem is holding back progress in Debian. It would be great if this bug could be fixed in (next minor) release. Thanks.
[17 Nov 12:26] MySQL Verification Team
Hello Dmitry Smirnov,

Thank you for the bug report.
Could you please try with the latest version i.e 8.0.31?

Regards,
Ashwini Patil
[22 Nov 13:01] Dmitry Smirnov
8.0.31 did not even get that far as it FTBFS as follows:

```
/build/mysql-workbench-8.0.31+dfsg/library/sql.parser/source/myx_statement_parser.cpp: In member function 'void mysql_parser::MyxStatementParser::process(std::istream&, mysql_parser::process_sql_statement_callback, void*, int)': 
/build/mysql-workbench-8.0.31+dfsg/library/sql.parser/source/myx_statement_parser.cpp:159:5: error: 'state' may be used uninitialized [-Werror=maybe-uninitialized] 
  159 |     switch(state) { 
      |     ^~~~~~ 
/build/mysql-workbench-8.0.31+dfsg/library/sql.parser/source/myx_statement_parser.cpp:145:15: note: 'state' was declared here 
  145 |   ParserState state= start, prevState; 
      |               ^~~~~ 
cc1plus: all warnings being treated as errors 
make[4] *** [library/sql.parser/source/CMakeFiles/sqlparser.dir/build.make:429: library/sql.parser/source/CMakeFiles/sqlparser.dir/myx_statement_parser.cpp.o] Error 1 
```

With `-Wno-error=maybe-uninitialized` compilation progressed a bit further then FTBFS as follows:

```
/mnt/01/src/m-w/mysql-workbench-community-8.0.31-src/library/base/file_utilities.cpp:118:28: error: ‘g_pattern_spec_match_string’ was not declared in this scope; did you mean ‘g_pattern_match_string’?                                                                                                                                                        
  118 |       bool match_string  = g_pattern_spec_match_string(pat, filename); 
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 
      |                            g_pattern_match_string 
make[4] *** [library/base/CMakeFiles/wbbase.dir/build.make:149: library/base/CMakeFiles/wbbase.dir/file_utilities.cpp.o] Error 1 
```

---

Worst of all, Ashwini Patil, you are wasting my time by doing support on me: comparing to 8.0.30 (which FTBFS just like 8.0.29), 8.0.31 have no ODBC-related changes in source. As far as I can see, nobody even tried to address this issue yet...  :(