Bug #8599 Compile failure in handler.cc / ha_federated.h

Submitted: 18 Feb 2005 12:10 Modified: 5 Apr 2005 21:23
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.0.3-pre OS:HP/UX (HP-UX)
Assigned to: Bugs System CPU Architecture:Any

[18 Feb 2005 12:10] Joerg Bruehe
Description:
Compile problem on HP-UX prevents build there:

Error 221: "ha_federated.h", line 75 # Member 'create_where_from_key' not declared in class ha_federated ["ha_federated.h", line 59].
      bool ha_federated::create_where_from_key(String *to, KEY *key_info, const byte *key
                         ^^^^^^^^^^^^^^^^^^^^^                                           
gmake[4]: *** [handler.o] Error 2

This happens on hp3750, hp3750-64bit, hpita2-64bit, hpux11, hpux11-64bit

Latest changeset:
  1.1852 05/02/17 18:07:14 jimw@mysql.com +5 -0
  Clean up merge from 4.1, including making several enum fields
  in the grant tables case-insensitive and updating test results.

In the 64 bit compiles, these warnings follow (all refer to HA_FILE_BASED):
Warning 863: "handler.cc", line 975 # Result of operator << is widened from int to unsigned long.
      if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED))
                                                                  ^^^^^^^^^^^^^  
Warning 863: "handler.cc", line 1571 # Result of operator << is widened from int to unsigned long.
          !(table.file->table_flags() & HA_FILE_BASED))
                                        ^^^^^^^^^^^^^  
Warning 863: "handler.cc", line 1636 # Result of operator << is widened from int to unsigned long.
            !(table.file->table_flags() & HA_FILE_BASED))
                                          ^^^^^^^^^^^^^  

How to repeat:
Build on any of these HP-UX machines.
[19 Feb 2005 4:56] Patrick Galbraith
I'm trying to build on hpux11 and hp3750, using the build options from logfile:
 such as on hp3750:

 CC=cc CXX=aCC CFLAGS="-DBIG_TABLES +DAportable" CXXFLAGS="-DBIG_TABLES -DAPortable" ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data -libexecdir=/usr/local/mysql/bin --with-extra_charsets=complex --with-server-suffix="-max" --enable-thread-safe-client --enable-local-infile --disable-shared --with-berkely-db --with-low-memory --with-readline --with-embedded-server --with-innodb

Then, when I run 'make', I get:

Making all in Docs
                cd . && \
                        /bin/sh /home/mysqldev/patg/mysql-5.0/missing --run
                        makeinfo -I . --no-headers --no-split --output
                        manual.txt
                        makeinfo: missing file argument.
                        Try `makeinfo --help' for more information.
                        *** Error exit code 1

                        Stop.
                        *** Error exit code 1

                        Stop.
                        *** Error exit code 1

                        Stop.

Is this something simple I'm missing? I want to try to see if my code fixes work, but can't get past this in either case. If someone could help me get past this, I can see if my pending patches work. 

Thanks much ;)
[19 Feb 2005 5:16] Patrick Galbraith
Ok, I got past the problems with makeinfo by just nixing 'Docs' from the SUBDIRS list in the main Makefile, and the compile proceeds as far as:

cc -O -DDBUG_OFF -DBIG_TABLES +DAportable -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -o mysql_client_test mysql_client_test.o  ../libmysql/.libs/libmysqlclient.a /home/mysqldev/patg/mysql-5.0/zlib/.libs/libz.a -lpthread -lpthread ../mysys/libmysys.a ../zlib/.libs/libz.a -lpthread -lcrypt -lnsl -lm -lpthread
        source='insert_test.c' object='insert_test.o' libtool=no \
        depfile='.deps/insert_test.Po' tmpdepfile='.deps/insert_test.TPo' \
        depmode=hp /bin/sh ../depcomp \
        cc -DUNDEF_THREADS_HACK -I. -I. -I.. -I../include      -O -DDBUG_OFF -DBIG_TABLES +DAportable   -DHPUX11  -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -c `test -f 'insert_test.c' || echo './'`insert_test.c
cc: "../include/mysql.h", line 502: error 1000: Unexpected symbol: "*".
cc: "../include/mysql.h", line 502: error 1573: Type of "to" is undefined due to an illegal declaration.
*** Error exit code 1

Note: previous to this, there are multitudes of this error:

Warning 740: "item_subselect.h", line 151 # Unsafe cast between pointers/references to incomplete classes: casting
    'Item_cache *' to 'Item *'.
      Item* el(uint i) { return my_reinterpret_cast(Item*)(row[i]); }
                                                           ^^^^^^    
Warning 749: "sql_lex.h", line 393 # The cast from 'st_select_lex_node *' to 'st_select_lex *' is performed as a
    'reinterpret_cast'. This operation is non-portable and potentially unsafe.
        return my_reinterpret_cast(st_select_lex*)(slave);
[19 Feb 2005 8:38] Sergei Golubchik
That was fixed yesterday, before the build.

The problem is that HP compiler does not like

      bool ha_federated::create_where_from_key(String *to,
                                                      KEY *key_info, const byte *key

in the class definition. It should be

      bool create_where_from_key(String *to,
                                                      KEY *key_info, const byte *key

(this happened many times already - pytical copy-paste error :)
[19 Feb 2005 18:02] Patrick Galbraith
The previous error is due to a change I've made to mysql.h that makes cli_fetch_lengths useable in my handler:

unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
// this line (this comment is not in the code)
void            STDCALL cli_fetch_lengths(ulong *to, MYSQL_ROW column,
                              unsigned int field_count);
MYSQL_FIELD *   STDCALL mysql_fetch_field(MYSQL_RES *result);

So, I've changed the line to:

 void       STDCALL cli_fetch_lengths(unsigned long *to, MYSQL_ROW column,
                              unsigned int field_count);

And it gets past that point, but then fails at:

/usr/bin/sed \
          -e 's!@''testdir''@!/usr/local/mysql/mysql-test!g' \
          -e 's!@''bindir''@!/usr/local/mysql/bin!g' \
          -e 's!@''scriptdir''@!/usr/local/mysql/bin!g' \
          -e 's!@''prefix''@!/usr/local/mysql!g' \
          -e 's!@''datadir''@!/usr/local/mysql/share!g' \
          -e 's!@''localstatedir''@!/usr/local/mysql/data!g' \
          -e 's!@''libexecdir''@!/usr/local/mysql/bin!g' \
          -e 's!@''PERL''@!/opt/perl/bin/perl!' \
          -e 's!@''VERSION''@!5.0.3-alpha!' \
          -e 's!@''MYSQL_TCP_PORT''@!3306!' \
          -e 's!@''MYSQL_BASE_VERSION''@!5.0!' \
          -e 's!@''MYSQL_UNIX_ADDR''@!/tmp/mysql.sock!' \
          -e 's!@''MYSQL_TCP_PORT''@!3306!' \
          -e 's!@''MYSQL_NO_DASH_VERSION''@!5.0.3!' \
          -e 's!@''MYSQL_SERVER_SUFFIX''@!-max!' \
          install_test_db.sh > install_test_db-t
        /usr/bin/chmod +x install_test_db-t
        /usr/bin/mv install_test_db-t install_test_db
Make: Don't know how to make std_data/client-key.pem.  Stop.
*** Error exit code 1
[19 Feb 2005 18:50] Patrick Galbraith
just typing 'make' again got the code to complete the compile (???), and federated compiles and links with the change to mysql.h and serg's recommended fix to ha_federated.h, but when I run the tests, a warning is given that the tables are defaulting to MyISAM. I need to <try> to compile with --debug and run the tests in debug mode. The original problem for this bug is fixed, but I'm not sure if that means this bug report should be closed. I will consult someone in eng or dev about this.
[5 Apr 2005 21:23] Patrick Galbraith
Fixed - this was due to a test result that had the wrong values.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.058 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.