List:Internals« Previous MessageNext Message »
From:Hiromichi Watari Date:February 9 2009 8:46pm
Subject:Re: Build with debug option
View as plain text  
Hi Chad,
Thank you for your input, maybe I didn't make myself clear but I got the errors on make
with the unmodified source.  Here is more details,



//***************** make errors (partial)
$ ./configure --with-debug
$ make
          .
          .
          .

g++ -g -O -DSAFE_MUTEX -fno-implicit-templates -fno-exceptions -fno-rtti -rdynamic -o
.libs/mysql mysql.o readline.o sql_string.o completion_hash.o 
../cmd-line-utils/libedit/libedit.a -lncurses -lpthread
../libmysql/.libs/libmysqlclient.so -lstdc++ ../zlib/.libs/libzlt.a -lrt -lcrypt -lnsl
-lm  -Wl,--rpath -Wl,/usr/local/lib/mysql
mysql.o: In function `build_completion_hash':
/usr/local/mysql-6.0/client/mysql.cc:2520: undefined reference to `_db_enter_'
/usr/local/mysql-6.0/client/mysql.cc:2523: undefined reference to `_db_return_'
/usr/local/mysql-6.0/client/mysql.cc:2525: undefined reference to `_db_return_'
/usr/local/mysql-6.0/client/mysql.cc:2583: undefined reference to `_db_return_'
/usr/local/mysql-6.0/client/mysql.cc:2590: undefined reference to `_db_return_'
/usr/local/mysql-6.0/client/mysql.cc:2628: undefined reference to `_db_return_'




//******************   Here is the source(unmodified mysql.cc, version 6.0)  
*************************

/* Build up the completion hash */

static void build_completion_hash(bool rehash, bool write_info)
{
  COMMANDS *cmd=commands;
  MYSQL_RES *databases=0,*tables=0;
  MYSQL_RES *fields;
  static char ***field_names= 0;
  MYSQL_ROW database_row,table_row;
  MYSQL_FIELD *sql_field;
  char buf[NAME_LEN*2+2];		 // table name plus field name plus 2
  int i,j,num_fields;
  DBUG_ENTER("build_completion_hash");          //*******************line 2520

  if (status.batch || quick || !current_db)
    DBUG_VOID_RETURN;			// We don't need completion in batches
  if (!rehash)
    DBUG_VOID_RETURN;

  /* Free old used memory */
  if (field_names)
    field_names=0;
  completion_hash_clean(&ht);
  free_root(&hash_mem_root,MYF(0));

  /* hash this file's known subset of SQL commands */
  while (cmd->name) {
    add_word(&ht,(char*) cmd->name);
    cmd++;
  }

  /* hash MySQL functions (to be implemented) */

  /* hash all database names */
  if (mysql_query(&mysql,"show databases") == 0)
  {
    if (!(databases = mysql_store_result(&mysql)))
      put_info(mysql_error(&mysql),INFO_INFO);
    else
    {
      while ((database_row=mysql_fetch_row(databases)))
      {
	char *str=strdup_root(&hash_mem_root, (char*) database_row[0]);
	if (str)
	  add_word(&ht,(char*) str);
      }
      mysql_free_result(databases);
    }
  }
  /* hash all table names */
  if (mysql_query(&mysql,"show tables")==0)
  {
    if (!(tables = mysql_store_result(&mysql)))
      put_info(mysql_error(&mysql),INFO_INFO);
    else
    {
      if (mysql_num_rows(tables) > 0 && !opt_silent && write_info)
      {
	tee_fprintf(stdout, "\
Reading table information for completion of table and column names\n\
You can turn off this feature to get a quicker startup with -A\n\n");
      }
      while ((table_row=mysql_fetch_row(tables)))
      {
	char *str=strdup_root(&hash_mem_root, (char*) table_row[0]);
	if (str &&
	    !completion_hash_exists(&ht,(char*) str, (uint) strlen(str)))
	  add_word(&ht,str);
      }
    }
  }

  /* hash all field names, both with the table prefix and without it */
  if (!tables)					/* no tables */
  {
    DBUG_VOID_RETURN;                 //****************** line 2583
  }
  mysql_data_seek(tables,0);
  if (!(field_names= (char ***) alloc_root(&hash_mem_root,sizeof(char **) *
					   (uint) (mysql_num_rows(tables)+1))))
  {
    mysql_free_result(tables);
    DBUG_VOID_RETURN;
  }
  i=0;
  while ((table_row=mysql_fetch_row(tables)))
  {
    if ((fields=mysql_list_fields(&mysql,(const char*) table_row[0],NullS)))
    {
      num_fields=mysql_num_fields(fields);
      if (!(field_names[i] = (char **) alloc_root(&hash_mem_root,
						  sizeof(char *) *
						  (num_fields*2+1))))
      {
        mysql_free_result(fields);
        break;
      }
      field_names[i][num_fields*2]= '\0';
      j=0;
      while ((sql_field=mysql_fetch_field(fields)))
      {
	sprintf(buf,"%.64s.%.64s",table_row[0],sql_field->name);
	field_names[i][j] = strdup_root(&hash_mem_root,buf);
	add_word(&ht,field_names[i][j]);
	field_names[i][num_fields+j] = strdup_root(&hash_mem_root,
						   sql_field->name);
	if (!completion_hash_exists(&ht,field_names[i][num_fields+j],
				    (uint) strlen(field_names[i][num_fields+j])))
	  add_word(&ht,field_names[i][num_fields+j]);
	j++;
      }
      mysql_free_result(fields);
    }
    else
      field_names[i]= 0;

    i++;
  }
  mysql_free_result(tables);
  field_names[i]=0;				// End pointer
  DBUG_VOID_RETURN;                        //************* line 2628
}



--- On Mon, 2/9/09, Chad MILLER <chad@stripped> wrote:

> From: Chad MILLER <chad@stripped>
> Subject: Re: Build with debug option
> To: hiromichiwatari@stripped
> Cc: internals@stripped
> Date: Monday, February 9, 2009, 12:39 PM
> On 9 Feb 2009, at 11:57, Hiromichi Watari wrote:
> 
> > 
> > I'm trying to build from development 6.0 source
> with debug option with the following make error(first of
> many).
> > 
> > $ ./configure --with-debug
> >         .
> >         .
> >         .
> > mysql.o: In function `build_completion_hash':
> > /usr/local/mysql-6.0-build/client/mysql.cc:2516:
> undefined reference to `_db_enter_'
> > 
> > 
> > 
> > I did pull in the source tree with dbug directory with
> dbug_long.h, dbug.c and so on.
> > Anybody has any idea ?
> 
> 
> I haven't looked at the source, but that is usually a
> case of having a
> DBUG_*RETURN without a DBUG_ENTER.  DBUG_ENTER creates some
> variables to hold state about this stack frame.  DBUG_RETURN
> uses them to validate execution.  Having one without the
> other should be an error, but it usually manifests itself as
> that cryptic message.
> 
> - chad
> 
> --MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:   
> http://lists.mysql.com/internals?unsub=1


      
Thread
Build with debug optionHiromichi Watari9 Feb
  • Re: Build with debug optionChad MILLER9 Feb
    • Re: Build with debug optionHiromichi Watari9 Feb
      • Re: Build with debug optionGuilhem Bichot9 Feb
        • Re: Build with debug optionHiromichi Watari10 Feb
          • Re: Build with debug optionGuilhem Bichot10 Feb
            • Re: Build with debug optionHiromichi Watari10 Feb
              • Re: Build with debug optionVladimir Shebordaev10 Feb
                • Re: Build with debug optionHiromichi Watari10 Feb
                  • Re: Build with debug optionVladimir Shebordaev12 Feb
              • Re: Build with debug optionGuilhem Bichot10 Feb
                • Re: Build with debug optionHiromichi Watari11 Feb
                  • Re: Build with debug optionGuilhem Bichot11 Feb
                    • Re: Build with debug optionHiromichi Watari11 Feb
                      • Re: Build with debug optionGuilhem Bichot11 Feb
                        • Re: Build with debug optionHiromichi Watari12 Feb