Bug #53908 compile failure with embedded enabled - sql_parse.cc:520: error: 'struct NET' ha
Submitted: 22 May 2010 1:54 Modified: 14 Oct 2010 15:31
Reporter: Robin Johnson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0.91, 5.0.92 OS:Any
Assigned to: Davi Arnaut CPU Architecture:Any
Tags: Contribution, regression
Triage: Triaged: D2 (Serious)

[22 May 2010 1:54] Robin Johnson
Description:
5.0.91 fails to compile with embedded enabled.

sql_parse.cc: In function 'int check_user(THD*, enum_server_command, const char*, uint, const char*, bool)':
sql_parse.cc:520: error: 'struct NET' has no member named 'skip_big_packet'

How to repeat:
Try to compile 5.0.91 with embedded.

Suggested fix:
diff -Nuar mysql-5.0.91.orig//sql/sql_parse.cc mysql-5.0.91//sql/sql_parse.cc
--- mysql-5.0.91.orig//sql/sql_parse.cc	2010-05-05 14:07:10.000000000 +0000
+++ mysql-5.0.91//sql/sql_parse.cc	2010-05-21 20:29:16.714903163 +0000
@@ -499,7 +499,9 @@
         big packets indefinitely, this is a previously established behavior
         that needs to be preserved as to not break backwards compatibility.
       */
+#if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
       thd->net.skip_big_packet= TRUE;
+#endif
       /* Ready to handle queries */
       DBUG_RETURN(0);
     }
[22 May 2010 3:48] Miguel Solorzano
Thank you for the bug report. I couldn't repeat on Slackware 13.1 X86_64 compiling today source tree, please try the latest source. Thanks in advance.

miguel@tikal:~$ bzr/5.0-build/libmysqld/examples/mysql
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
100522  0:42:33  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 0
Server version: 5.0.92-embedded-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like "%version%";
+-------------------------+-----------------------+
| Variable_name           | Value                 |
+-------------------------+-----------------------+
| protocol_version        | 10                    | 
| version                 | 5.0.92-embedded-debug | 
| version_comment         | Source distribution   | 
| version_compile_machine | x86_64                | 
| version_compile_os      | unknown-linux-gnu     | 
+-------------------------+-----------------------+
5 rows in set (0.00 sec)

mysql> exit
Bye
miguel@tikal:~$ cd bzr
miguel@tikal:~/bzr$ cd 5.0-build/
miguel@tikal:~/bzr/5.0-build$ bzr revno
2864
miguel@tikal:~/bzr/5.0-build$
[22 May 2010 4:00] Robin Johnson
This is against the publicly released 5.0.91 tarball.

Here is the bad commit:
http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.0/revision/2860
[22 May 2010 14:11] Valeriy Kravchuk
Verified with recent 5.0.92-bzr on Mac OS X:

./configure --prefix=/Users/openxs/dbs/5.0 --with-embedded-server --with-embedded-privilege-control
make clean
make

...
     -O3 -DDBUG_OFF    -fno-implicit-templates -fno-exceptions -fno-rtti -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -MT sql_parse.o -MD -MP -MF .deps/sql_parse.Tpo -c -o sql_parse.o sql_parse.cc
sql_parse.cc: In function ‘int check_user(THD*, enum_server_command, const char*, uint, const char*, bool)’:
sql_parse.cc:502: error: ‘struct NET’ has no member named ‘skip_big_packet’
make[3]: *** [sql_parse.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
[24 May 2010 22:41] Omer Barnir
Bug is in 5.0 only that is past EOL
[24 May 2010 22:51] Robin Johnson
It was fine in 5.0.90 and introduced in 5.0.91.

Please fix in case you make another security release like 5.0.91 was.
I've given you the patch, it's entirely trivial.
[25 May 2010 12:57] Davi Arnaut
Fixing since it was introduced in 5.0.90. Although, a new release may or may not happen.
[25 May 2010 13:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/109180

2864 Davi Arnaut	2010-05-25
      Bug#53908: compile failure with embedded enabled
      
      This fixes a recently introduced regression, where a variable is
      not defined for the embedded server. Although the embedded server
      is not supported in 5.0, make it at least compile.
[25 May 2010 13:45] Davi Arnaut
Queued to mysql-5.1-bugteam.
[2 Jun 2010 8:43] Bugs System
Pushed into 5.0.92 (revid:georgi.kodinov@oracle.com-20100602084237-ohj84dfs8yocsho0) (version source revid:ramil@mysql.com-20100525140747-0jspc9f8mx2btz0b) (merge vers: 5.0.91) (pib:16)
[2 Jun 2010 8:50] Bugs System
Pushed into 5.1.48 (revid:georgi.kodinov@oracle.com-20100602084411-2yu607bslbmgufl3) (version source revid:kristofer.pettersson@oracle.com-20100526151733-st1tsjoz6xkvb096) (merge vers: 5.1.47) (pib:16)
[3 Jun 2010 7:39] MC Brown
A note has been added to the 5.0.92 and 5.1.47 changelog: 

Builds of the embedded <command>mysqld</command> would fail due to a missing element of the <literal>struct NET</literal>.
[3 Jun 2010 7:40] MC Brown
Correction 5.1.48 changelog
[17 Jun 2010 6:14] Bugs System
Pushed into 5.5.5-m3 (revid:alexey.kopytov@sun.com-20100615145247-8bj0vmuqlotbqsn9) (version source revid:alexey.kopytov@sun.com-20100527104212-cloj25taqgmyp2of) (merge vers: 5.5.5-m3) (pib:16)
[17 Jun 2010 6:18] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615150216-cubqoyn1fj9b6a2p) (version source revid:vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh) (pib:16)
[17 Jun 2010 7:32] MC Brown
Added to the 5.5.5 changelog
[14 Oct 2010 8:36] Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.20 (revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (version source revid:vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh) (merge vers: 5.5.5-m3) (pib:21)
[14 Oct 2010 8:51] Bugs System
Pushed into mysql-5.1-telco-6.3 5.1.51-ndb-6.3.39 (revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (version source revid:vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh) (merge vers: 5.5.5-m3) (pib:21)
[14 Oct 2010 9:06] Bugs System
Pushed into mysql-5.1-telco-6.2 5.1.51-ndb-6.2.19 (revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (version source revid:vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh) (merge vers: 5.5.5-m3) (pib:21)
[14 Oct 2010 15:31] Jon Stephens
Already documented in the 5.1.48 changelog; no new changelog entries required. Setting back to Closed state.