MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Paul DuBois Date:December 8 2007 12:02am
Subject:Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535
View as plain text  
At 2:03 AM +0300 12/8/07, Konstantin Osipov wrote:
>* Sergei Golubchik <serg@stripped> [07/12/07 23:52]:
>
>OK, so I dug up the book by Paul.
>
>Here's the chapter in question:
>
>http://www.informit.com/articles/article.aspx?p=30494&seqNum=5&rl=1
>
>Here's the famous example:
>
>#include <stdio.h>
>#include <mysql.h>
>
>char *groups[] = { "client", NULL };
>
>int
>main (int argc, char *argv[])
>{
>   int i;
>
>   my_init ();
>
>   printf ("Original argument vector:\n");
>   for (i = 0; i < argc; i++)
>     printf ("arg %d: %s\n", i, argv[i]);
>
>   load_defaults ("my", groups, &argc, &argv);
>
>   printf ("Modified argument vector:\n");
>   for (i = 0; i < argc; i++)
>     printf ("arg %d: %s\n", i, argv[i]);
>
>   exit (0);
>}
>
>
>As you can see, the example refers to my_init().
>my_init() is no more included in mysql.h, as of 5.1, just as well.

Current example (from third edition):

#include <my_global.h>
#include <my_sys.h>
#include <mysql.h>

static const char *client_groups[] = { "client", NULL };

int
main (int argc, char *argv[])
{
int i;

     printf ("Original argument vector:\n");
     for (i = 0; i < argc; i++)
         printf ("arg %d: %s\n", i, argv[i]);

     MY_INIT (argv[0]);
     load_defaults ("my", client_groups, &argc, &argv);

     printf ("Modified argument vector:\n");
     for (i = 0; i < argc; i++)
         printf ("arg %d: %s\n", i, argv[i]);

     exit (0);
}

The header files are different, and it uses MY_INIT() rather
than my_init().  I seem to be using the same example for the
(now-in-progress) fourth edition.  Is the current code okay?

-- 
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Thread
bk commit into 5.1 tree (kostja:1.2614) BUG#25535konstantin4 Dec
  • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik6 Dec
    • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov6 Dec
      • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik7 Dec
        • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov7 Dec
          • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Paul DuBois7 Dec
            • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov7 Dec
          • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik7 Dec
            • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov7 Dec
              • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik7 Dec
                • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov7 Dec
                  • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik11 Dec
                • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov7 Dec
                  • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik11 Dec
                    • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Paul DuBois11 Dec
                • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov8 Dec
                  • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Paul DuBois8 Dec
                    • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov8 Dec
                    • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik11 Dec
                      • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Konstantin Osipov11 Dec
                        • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik11 Dec
                        • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Paul DuBois5 Feb
                      • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Paul DuBois11 Dec
                        • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Paul DuBois11 Dec
                          • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Sergei Golubchik11 Dec
                            • Re: bk commit into 5.1 tree (kostja:1.2614) BUG#25535Paul DuBois11 Dec