~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to sql/item_func.cc

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), 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)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + 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.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2739
2739
          if (is_last_item && !is_separator)
2740
2740
            str_end= substr_end;
2741
2741
          if (!my_strnncoll(cs, (const uchar *) str_begin,
2742
 
                            str_end - str_begin,
 
2742
                            (uint) (str_end - str_begin),
2743
2743
                            find_str, find_str_len))
2744
2744
            return (longlong) position;
2745
2745
          else
3808
3808
}
3809
3809
 
3810
3810
 
 
3811
void Item_func_set_user_var::cleanup()
 
3812
{
 
3813
  Item_func::cleanup();
 
3814
  entry= NULL;
 
3815
}
 
3816
 
 
3817
 
3811
3818
bool Item_func_set_user_var::set_entry(THD *thd, bool create_if_not_exists)
3812
3819
{
3813
3820
  if (entry && thd->thread_id == entry_thread_id)
4307
4314
}
4308
4315
 
4309
4316
 
 
4317
bool Item_func_set_user_var::is_null_result()
 
4318
{
 
4319
  DBUG_ASSERT(fixed == 1);
 
4320
  check(TRUE);
 
4321
  update();                                     // Store expression
 
4322
  return is_null();
 
4323
}
 
4324
 
 
4325
 
4310
4326
void Item_func_set_user_var::print(String *str, enum_query_type query_type)
4311
4327
{
4312
4328
  str->append(STRING_WITH_LEN("(@"));
4809
4825
  component(*component_arg), cache_present(0)
4810
4826
{
4811
4827
  /* set_name() will allocate the name */
4812
 
  set_name(name_arg, name_len_arg, system_charset_info);
 
4828
  set_name(name_arg, (uint) name_len_arg, system_charset_info);
4813
4829
}
4814
4830
 
4815
4831
 
4821
4837
 
4822
4838
void Item_func_get_system_var::fix_length_and_dec()
4823
4839
{
 
4840
  char *cptr;
4824
4841
  maybe_null=0;
 
4842
  max_length= 0;
4825
4843
 
4826
4844
  if (var->check_type(var_type))
4827
4845
  {
4851
4869
      break;
4852
4870
    case SHOW_CHAR:
4853
4871
    case SHOW_CHAR_PTR:
 
4872
      pthread_mutex_lock(&LOCK_global_system_variables);
 
4873
      cptr= var->show_type() == SHOW_CHAR_PTR ? 
 
4874
        *(char**) var->value_ptr(current_thd, var_type, &component) :
 
4875
        (char*) var->value_ptr(current_thd, var_type, &component);
 
4876
      if (cptr)
 
4877
        max_length= strlen(cptr) * system_charset_info->mbmaxlen;
 
4878
      pthread_mutex_unlock(&LOCK_global_system_variables);
4854
4879
      collation.set(system_charset_info, DERIVATION_SYSCONST);
4855
 
      max_length= MAX_BLOB_WIDTH;
4856
4880
      decimals=NOT_FIXED_DEC;
4857
4881
      break;
4858
4882
    case SHOW_BOOL:
5355
5379
    if (item->type() == Item::REF_ITEM)
5356
5380
      args[i]= item= *((Item_ref *)item)->ref;
5357
5381
    if (item->type() != Item::FIELD_ITEM)
5358
 
      key=NO_SUCH_KEY;
 
5382
    {
 
5383
      my_error(ER_WRONG_ARGUMENTS, MYF(0), "AGAINST");
 
5384
      return TRUE;
 
5385
    }
5359
5386
  }
5360
5387
  /*
5361
5388
    Check that all columns come from the same table.