Commit 31959774 authored by unknown's avatar unknown
Browse files

Merge siva.hindu.god:/usr/home/tim/m/bk/g51

into  siva.hindu.god:/usr/home/tim/m/bk/51


include/m_ctype.h:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/rename.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysys/mf_iocache.c:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/table.cc:
  Auto merged
storage/myisam/sort.c:
  Manual merge
parents 9852dfbc 5742b2bf
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5,5 +5,13 @@
45001f7c3b2hhCXDKfUvzkX9TNe6VA
45002051rHJfMEXAIMiAZV0clxvKSA
4513d8e4Af4dQWuk13sArwofRgFDQw
45143312u0Tz4r0wPXCbUKwdHa2jWA
45143b90ewOQuTW8-jrB3ZSAQvMRJw
45184588w9U72A6KX1hUFeAC4shSHA
45185df8mZbxfp85FbA0VxUXkmDewA
4519a6c5BVUxEHTf5iJnjZkixMBs8g
451ab499rgdjXyOnUDqHu-wBDoS-OQ
451b110a3ZV6MITl93ehXk2wxrbW7g
45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA
+2 −1
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ mysqladmin_SOURCES = mysqladmin.cc
mysql_LDADD =			@readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
mysqltest_SOURCES=		mysqltest.c $(top_srcdir)/mysys/my_getsystime.c \
				$(yassl_dummy_link_fix)
mysqltest_LDADD =		$(top_builddir)/regex/libregex.a $(LDADD)
mysqltest_LDADD =		$(top_builddir)/regex/libregex.a $(LDADD) \
				$(top_builddir)/mysys/libmysys.a
mysqlbinlog_SOURCES =		mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c \
				$(top_srcdir)/mysys/my_new.cc \
				$(top_srcdir)/mysys/my_bit.c \
+15 −0
Original line number Diff line number Diff line
@@ -386,6 +386,21 @@ int main(int argc,char *argv[])
  else
    status.add_to_history=1;
  status.exit_status=1;

  {
    /* 
     The file descriptor-layer may be out-of-sync with the file-number layer,
     so we make sure that "stdout" is really open.  If its file is closed then
     explicitly close the FD layer. 
    */
    int stdout_fileno_copy;
    stdout_fileno_copy= dup(fileno(stdout)); /* Okay if fileno fails. */
    if (stdout_fileno_copy == -1)
      fclose(stdout);
    else
      close(stdout_fileno_copy);             /* Clean up dup(). */
  }

  load_defaults("my",load_default_groups,&argc,&argv);
  defaults_argv=argv;
  if (get_options(argc, (char **) argv))
+101 −41
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
#include <m_string.h>
#include <m_ctype.h>
#include <hash.h>
#include <stdarg.h>

#include "client_priv.h"
#include "mysql.h"
@@ -536,6 +537,8 @@ static void write_header(FILE *sql_file, char *db_name)
  if (opt_xml)
  {
    fputs("<?xml version=\"1.0\"?>\n", sql_file);
    /* Schema reference.  Allows use of xsi:nil for NULL values and 
       xsi:type to define an element's data type. */
    fputs("<mysqldump ", sql_file);
    fputs("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
          sql_file);
@@ -1136,7 +1139,7 @@ static char *quote_for_like(const char *name, char *buff)

  SYNOPSIS
    print_quoted_xml()
    output      - output file
    xml_file    - output file
    str         - string to print
    len         - its length

@@ -1173,34 +1176,63 @@ static void print_quoted_xml(FILE *xml_file, const char *str, ulong len)


/*
  Print xml tag with one attribute.
  Print xml tag. Optionally add attribute(s).

  SYNOPSIS
    print_xml_tag1()
    print_xml_tag(xml_file, sbeg, send, tag_name, first_attribute_name, 
                    ..., attribute_name_n, attribute_value_n, NullS)
    xml_file              - output file
    sbeg                  - line beginning
    stag_atr    - tag and attribute
    sval        - value of attribute
    send                  - line ending
    tag_name              - XML tag name.
    first_attribute_name  - tag and first attribute
    first_attribute_value - (Implied) value of first attribute
    attribute_name_n      - attribute n
    attribute_value_n     - value of attribute n

  DESCRIPTION
    Print tag with one attribute to the xml_file. Format is:
      sbeg<stag_atr="sval">send
    Print XML tag with any number of attribute="value" pairs to the xml_file.

    Format is:
      sbeg<tag_name first_attribute_name="first_attribute_value" ... 
      attribute_name_n="attribute_value_n">send
  NOTE
    sval MUST be a NULL terminated string.
    sval string will be qouted before output.
    Additional arguments must be present in attribute/value pairs.
    The last argument should be the null character pointer.
    All attribute_value arguments MUST be NULL terminated strings.
    All attribute_value arguments will be quoted before output.
*/

static void print_xml_tag1(FILE * xml_file, const char* sbeg,
                           const char* stag_atr, const char* sval,
                           const char* send)
static void print_xml_tag(FILE * xml_file, const char* sbeg, const char* send, 
                          const char* tag_name, 
                          const char* first_attribute_name, ...)
{
  va_list arg_list;
  char *attribute_name, *attribute_value;

  fputs(sbeg, xml_file);
  fputs("<", xml_file);
  fputs(stag_atr, xml_file);
  fputs("\"", xml_file);
  print_quoted_xml(xml_file, sval, strlen(sval));
  fputs("\">", xml_file);
  fputc('<', xml_file);
  fputs(tag_name, xml_file);  

  va_start(arg_list, first_attribute_name);
  attribute_name= first_attribute_name;
  while (attribute_name != NullS)
  {
    attribute_value= va_arg(arg_list, char *);
    DBUG_ASSERT(attribute_value != NullS);

    fputc(' ', xml_file);
    fputs(attribute_name, xml_file);    
    fputc('\"', xml_file);
    
    print_quoted_xml(xml_file, attribute_value, strlen(attribute_value));
    fputc('\"', xml_file);

    attribute_name= va_arg(arg_list, char *);
  }
  va_end(arg_list);

  fputc('>', xml_file);
  fputs(send, xml_file);
  check_io(xml_file);
}
@@ -1410,6 +1442,28 @@ static uint dump_events_for_db(char *db)
}


/*
  Print hex value for blob data.

  SYNOPSIS
    print_blob_as_hex()
    output_file         - output file
    str                 - string to print
    len                 - its length

  DESCRIPTION
    Print hex value for blob data.
*/

static void print_blob_as_hex(FILE *output_file, const char *str, ulong len)
{
    /* sakaik got the idea to to provide blob's in hex notation. */
    char *ptr= str, *end= ptr + len;
    for (; ptr < end ; ptr++)
      fprintf(output_file, "%02X", *((uchar *)ptr));
    check_io(output_file);
}

/*
  dump_routines_for_db
  -- retrieves list of routines for a given db, and prints out
@@ -1857,7 +1911,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
      if (!opt_xml)
        fprintf(sql_file, "CREATE TABLE %s (\n", result_table);
      else
        print_xml_tag1(sql_file, "\t", "table_structure name=", table, "\n");
        print_xml_tag(sql_file, "\t", "\n", "table_structure", "name=", table, 
                NullS);
      check_io(sql_file);
    }

@@ -2429,8 +2484,8 @@ static void dump_table(char *table, char *db)
    rownr=0;
    init_length=(uint) insert_pat.length+4;
    if (opt_xml)
      print_xml_tag1(md_result_file, "\t", "table_data name=", table, "\n");

      print_xml_tag(md_result_file, "\t", "\n", "table_data", "name=", table,
              NullS);
    if (opt_autocommit)
    {
      fprintf(md_result_file, "set autocommit=0;\n");
@@ -2484,7 +2539,7 @@ static void dump_table(char *table, char *db)
                   field->type == MYSQL_TYPE_LONG_BLOB ||
                   field->type == MYSQL_TYPE_MEDIUM_BLOB ||
                   field->type == MYSQL_TYPE_TINY_BLOB)) ? 1 : 0;
        if (extended_insert)
        if (extended_insert && !opt_xml)
        {
          if (i == 0)
            dynstr_set(&extended_row,"(");
@@ -2573,18 +2628,25 @@ static void dump_table(char *table, char *db)
            {
              if (opt_xml)
              {
                print_xml_tag1(md_result_file, "\t\t", "field name=",
                              field->name, "");
                if (opt_hex_blob && is_blob && length)
                {
                    /* Define xsi:type="xs:hexBinary" for hex encoded data */
                    print_xml_tag(md_result_file, "\t\t", "", "field", "name=",
                            field->name, "xsi:type=", "xs:hexBinary", NullS);
                    print_blob_as_hex(md_result_file, row[i], length);
                }
                else
                {
                    print_xml_tag(md_result_file, "\t\t", "", "field", "name=", 
                            field->name, NullS);
                    print_quoted_xml(md_result_file, row[i], length);
                }
                fputs("</field>\n", md_result_file);
              }
              else if (opt_hex_blob && is_blob && length)
              {
                /* sakaik got the idea to to provide blob's in hex notation. */
                char *ptr= row[i], *end= ptr + length;
                fputs("0x", md_result_file);
                for (; ptr < end ; ptr++)
                  fprintf(md_result_file, "%02X", *((uchar *)ptr));
                print_blob_as_hex(md_result_file, row[i], length);
              }
              else
                unescape(md_result_file, row[i], length);
@@ -2595,8 +2657,8 @@ static void dump_table(char *table, char *db)
              char *ptr= row[i];
              if (opt_xml)
              {
                print_xml_tag1(md_result_file, "\t\t", "field name=",
                               field->name, "");
                print_xml_tag(md_result_file, "\t\t", "", "field", "name=",
                        field->name, NullS);
                fputs(!my_isalpha(charset_info, *ptr) ? ptr: "NULL",
                      md_result_file);
                fputs("</field>\n", md_result_file);
@@ -3070,7 +3132,7 @@ static int dump_all_tables_in_db(char *database)
  if (init_dumping(database, init_dumping_tables))
    return 1;
  if (opt_xml)
    print_xml_tag1(md_result_file, "", "database name=", database, "\n");
    print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NullS);
  if (lock_tables)
  {
    DYNAMIC_STRING query;
@@ -3153,7 +3215,7 @@ static my_bool dump_all_views_in_db(char *database)
  if (init_dumping(database, init_dumping_views))
    return 1;
  if (opt_xml)
    print_xml_tag1(md_result_file, "", "database name=", database, "\n");
    print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NullS);
  if (lock_tables)
  {
    DYNAMIC_STRING query;
@@ -3292,7 +3354,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
     /* We shall countinue here, if --force was given */
  }
  if (opt_xml)
    print_xml_tag1(md_result_file, "", "database name=", db, "\n");
    print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);

  /* Dump each selected table */
  for (pos= dump_tables; pos < end; pos++)
@@ -3405,7 +3467,7 @@ static int do_reset_master(MYSQL *mysql_con)
}


static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now)
static int start_transaction(MYSQL *mysql_con)
{
  /*
    We use BEGIN for old servers. --single-transaction --master-data will fail
@@ -3420,10 +3482,8 @@ static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now)
                                        "SET SESSION TRANSACTION ISOLATION "
                                        "LEVEL REPEATABLE READ") ||
          mysql_query_with_error_report(mysql_con, 0,
                                        consistent_read_now ?
                                        "START TRANSACTION "
                                        "WITH CONSISTENT SNAPSHOT" :
                                        "BEGIN"));
                                        "/*!40100 WITH CONSISTENT SNAPSHOT */"));
}


@@ -3913,7 +3973,7 @@ int main(int argc, char **argv)
  if ((opt_lock_all_tables || opt_master_data) &&
      do_flush_tables_read_lock(mysql))
    goto err;
  if (opt_single_transaction && start_transaction(mysql, test(opt_master_data)))
  if (opt_single_transaction && start_transaction(mysql))
      goto err;
  if (opt_delete_master_logs && do_reset_master(mysql))
    goto err;
+3402 −2576

File changed.

Preview size limit exceeded, changes collapsed.

Loading