Commit 2c168ec5 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl

into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge


ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
client/mysqldump.c:
  Merge main->rpl
mysql-test/r/mysqldump.result:
  Merge main->rpl
mysql-test/t/mysqldump.test:
  Merge main->rpl
parents 900e66f8 70bb923a
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
#! /bin/sh

path=`dirname $0`
. "$path/SETUP.sh"

extra_configs="$max_configs --with-ndb-test --with-ndb-ccflags='-DERROR_INSERT'"
if [ "$full_debug" ]
then
    extra_flags="$debug_cflags"
    c_warnings="$c_warnings $debug_extra_warnings"
    cxx_warnings="$cxx_warnings $debug_extra_warnings"
    extra_configs="$debug_configs $extra_configs"
else
    extra_flags="$fast_cflags"
fi

extra_flags="$extra_flags $max_cflags -g"

. "$path/FINISH.sh"
+55 −47
Original line number Diff line number Diff line
@@ -3266,6 +3266,8 @@ static char *primary_key_fields(const char *table_name)
  char show_keys_buff[15 + NAME_LEN * 2 + 3];
  uint result_length= 0;
  char *result= 0;
  char buff[NAME_LEN * 2 + 3];
  char *quoted_field;

  my_snprintf(show_keys_buff, sizeof(show_keys_buff),
              "SHOW KEYS FROM %s", table_name);
@@ -3289,8 +3291,10 @@ static char *primary_key_fields(const char *table_name)
  {
    /* Key is unique */
    do
      result_length += strlen(row[4]) + 1;      /* + 1 for ',' or \0 */
    while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1);
    {
      quoted_field= quote_name(row[4], buff, 0);
      result_length+= strlen(quoted_field) + 1; /* + 1 for ',' or \0 */
    } while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1);
  }

  /* Build the ORDER BY clause result */
@@ -3306,9 +3310,13 @@ static char *primary_key_fields(const char *table_name)
    }
    mysql_data_seek(res, 0);
    row= mysql_fetch_row(res);
    end = strmov(result, row[4]);
    quoted_field= quote_name(row[4], buff, 0);
    end= strmov(result, quoted_field);
    while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1)
      end = strxmov(end, ",", row[4], NullS);
    {
      quoted_field= quote_name(row[4], buff, 0);
      end= strxmov(end, ",", quoted_field, NullS);
    }
  }

cleanup:
+124 −0
Original line number Diff line number Diff line
@@ -2892,3 +2892,127 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
drop table t1;
drop user mysqltest_1@localhost;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `mysqldump_tables`;
DROP TABLE IF EXISTS `basetable`;
CREATE TABLE `basetable` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `tag` varchar(64) default NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

LOCK TABLES `basetable` WRITE;
/*!40000 ALTER TABLE `basetable` DISABLE KEYS */;
/*!40000 ALTER TABLE `basetable` ENABLE KEYS */;
UNLOCK TABLES;

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `mysqldump_views`;
DROP TABLE IF EXISTS `nasishnasifu`;
/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/;
/*!50001 CREATE TABLE `nasishnasifu` (
  `id` bigint(20) unsigned
) */;
/*!50001 DROP TABLE IF EXISTS `nasishnasifu`*/;
/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

drop view nasishnasifu;
drop database mysqldump_views;
drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
USE test;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` INT,
`c"d` INT,
`e``f` INT,
PRIMARY KEY (`a b`, `c"d`, `e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
insert into t1 values (0815, 4711, 2006);
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" (
  "a b" int(11) NOT NULL default '0',
  "c""d" int(11) NOT NULL default '0',
  "e`f" int(11) NOT NULL default '0',
  PRIMARY KEY  ("a b","c""d","e`f")
);

LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
INSERT INTO "t1" VALUES (815,4711,2006);
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
  `a b` int(11) NOT NULL default '0',
  `c"d` int(11) NOT NULL default '0',
  `e``f` int(11) NOT NULL default '0',
  PRIMARY KEY  (`a b`,`c"d`,`e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (815,4711,2006);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

DROP TABLE `t1`;
End of 5.0 tests
+28 −0
Original line number Diff line number Diff line
@@ -1309,3 +1309,31 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
# Clean up
drop table t1;
drop user mysqltest_1@localhost;

--exec $MYSQL_DUMP --skip-comments --databases mysqldump_tables mysqldump_views;

drop view nasishnasifu;
drop database mysqldump_views;
drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
USE test;

#
# BUG#13926: --order-by-primary fails if PKEY contains quote character
#
--disable_warnings
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
  `a b` INT,
  `c"d` INT,
  `e``f` INT,
  PRIMARY KEY (`a b`, `c"d`, `e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
insert into t1 values (0815, 4711, 2006);

--exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
--exec $MYSQL_DUMP --skip-comments --order-by-primary test t1
DROP TABLE `t1`;
--enable_warnings
--echo End of 5.0 tests
+1 −1
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ public:

  /**
   * Interpreted program instruction:
   * Substract RegSource1 from RegSource2 and put the result in RegDest.
   * Substract RegSource2 from RegSource1 and put the result in RegDest.
   *
   * @param RegSource1   First register.
   * @param RegSource2   Second register.
Loading