~ubuntu-branches/ubuntu/karmic/mysql-dfsg-5.1/karmic

« back to all changes in this revision

Viewing changes to client/mysql.cc

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-02-10 16:42:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090210164205-ej41ocvm4z1s14nq
Tags: 5.1.31-1ubuntu1
* Merge from debian experimental, remaining changes: 
  - debian/mysql-server-5.1.config: ask for MySQL root password at priority
    high instead of medium so that the password prompt is seen on a default
    install. (LP: #319843)
  - debian/control: 
    + Don't build mysql-server, mysql-client, mysql-common and 
      libmysqlclient15-dev binary packages since they're still provided 
      by mysql-dfsg-5.0.
    + Rename libmysqlclient-dev package to libmysqlclient16-dev (LP: #316280).
      Make it conflict with libmysqlclient15-dev.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide 
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src 
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
  - debian/rules: added -fno-strict-aliasing to CFLAGS to get
    around mysql testsuite build failures.
* debian/patches/92_ssl_test_cert.dpatch: certificate expiration in 
  test suite (LP: #323755).
* Dropped changes:
  - all of the changes made to support both 5.0 and 5.1 installed at the
    same time have been dropped now that amarok doesn't depend on
    mysql-server-5.1 anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1627
1627
    opt_nopager= 1;
1628
1628
    break;
1629
1629
  case OPT_MYSQL_PROTOCOL:
 
1630
#ifndef EMBEDDED_LIBRARY
1630
1631
    opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
1631
1632
                                    opt->name);
 
1633
#endif
1632
1634
    break;
1633
1635
  case OPT_SERVER_ARG:
1634
1636
#ifdef EMBEDDED_LIBRARY
2018
2020
  {
2019
2021
    if (!preserve_comments)
2020
2022
    {
2021
 
      // Skip spaces at the beggining of a statement
 
2023
      // Skip spaces at the beginning of a statement
2022
2024
      if (my_isspace(charset_info,inchar) && (out == line) &&
2023
2025
          buffer.is_empty())
2024
2026
        continue;
2101
2103
        continue;
2102
2104
      }
2103
2105
    }
2104
 
    else if (!*ml_comment && !*in_string &&
2105
 
             (end_of_line - pos) >= 10 &&
2106
 
             !my_strnncoll(charset_info, (uchar*) pos, 10,
2107
 
                           (const uchar*) "delimiter ", 10))
2108
 
    {
2109
 
      // Flush previously accepted characters
2110
 
      if (out != line)
2111
 
      {
2112
 
        buffer.append(line, (uint32) (out - line));
2113
 
        out= line;
2114
 
      }
2115
 
 
2116
 
      // Flush possible comments in the buffer
2117
 
      if (!buffer.is_empty())
2118
 
      {
2119
 
        if (com_go(&buffer, 0) > 0) // < 0 is not fatal
2120
 
          DBUG_RETURN(1);
2121
 
        buffer.length(0);
2122
 
      }
2123
 
 
2124
 
      /*
2125
 
        Delimiter wants the get rest of the given line as argument to
2126
 
        allow one to change ';' to ';;' and back
2127
 
      */
2128
 
      buffer.append(pos);
2129
 
      if (com_delimiter(&buffer, pos) > 0)
2130
 
        DBUG_RETURN(1);
2131
 
 
2132
 
      buffer.length(0);
2133
 
      break;
2134
 
    }
2135
2106
    else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
2136
2107
    {
2137
2108
      // Found a statement. Continue parsing after the delimiter
2194
2165
 
2195
2166
      // comment to end of line
2196
2167
      if (preserve_comments)
 
2168
      {
 
2169
        bool started_with_nothing= !buffer.length();
 
2170
 
2197
2171
        buffer.append(pos);
2198
2172
 
 
2173
        /*
 
2174
          A single-line comment by itself gets sent immediately so that
 
2175
          client commands (delimiter, status, etc) will be interpreted on
 
2176
          the next line.
 
2177
        */
 
2178
        if (started_with_nothing)
 
2179
        {
 
2180
          if (com_go(&buffer, 0) > 0)             // < 0 is not fatal
 
2181
            DBUG_RETURN(1);
 
2182
          buffer.length(0);
 
2183
        }
 
2184
      }
 
2185
 
2199
2186
      break;
2200
2187
    }
2201
2188
    else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&