summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-10-27 22:45:18 +0300
committermonty@mysql.com <>2005-10-27 22:45:18 +0300
commita9b1ff40951a74666f3de90c7d79f40fc507ae16 (patch)
treeb6d33b8036e354e85e5951e6312d4bed8430b87c
parentfaba744caf8c2f8da1b3b4e68d88ffd09a0e1601 (diff)
downloadmariadb-git-a9b1ff40951a74666f3de90c7d79f40fc507ae16.tar.gz
Add DROP TABLE before trying to create view (in mysqldump)
Cleaned up xxxx_gis.test's and made gis_generic.inc independent of ndb (Note that archive_gis.test fails, but this is independent of this patch)
-rw-r--r--client/mysqldump.c5
-rw-r--r--mysql-test/include/gis_generic.inc3
-rw-r--r--mysql-test/include/have_archive.inc6
-rw-r--r--mysql-test/include/have_geometry.inc6
-rw-r--r--mysql-test/r/mysqldump.result9
-rw-r--r--mysql-test/t/archive_gis.test5
-rw-r--r--mysql-test/t/bdb_gis.test1
-rw-r--r--mysql-test/t/innodb_gis.test3
-rw-r--r--mysql-test/t/ndb_gis.test1
-rw-r--r--sql/item_func.cc18
10 files changed, 32 insertions, 25 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index eb814c267ed..2ec1dd28f73 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1460,6 +1460,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
{
fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
opt_quoted_table);
+ fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n",
+ opt_quoted_table);
check_io(sql_file);
}
@@ -1471,7 +1473,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
*/
row= mysql_fetch_row(result);
- fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0), row[1]);
+ fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0),
+ row[1]);
while((row= mysql_fetch_row(result)))
{
diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc
index 0bfb2bc7470..e5e7283e0e6 100644
--- a/mysql-test/include/gis_generic.inc
+++ b/mysql-test/include/gis_generic.inc
@@ -1,5 +1,4 @@
-source include/have_geometry.inc;
---source include/have_ndb.inc
+--source include/have_geometry.inc
#
# Spatial objects
diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc
index f7fb942e83e..262f66076a8 100644
--- a/mysql-test/include/have_archive.inc
+++ b/mysql-test/include/have_archive.inc
@@ -1,4 +1,4 @@
--- require r/have_archive.require
-disable_query_log;
+--require r/have_archive.require
+--disable_query_log
show variables like "have_archive";
-enable_query_log;
+--enable_query_log
diff --git a/mysql-test/include/have_geometry.inc b/mysql-test/include/have_geometry.inc
index 169c3a41ee7..f0ec22af172 100644
--- a/mysql-test/include/have_geometry.inc
+++ b/mysql-test/include/have_geometry.inc
@@ -1,4 +1,4 @@
--- require r/have_geometry.require
-disable_query_log;
+--require r/have_geometry.require
+--disable_query_log
show variables like "have_geometry";
-enable_query_log;
+--enable_query_log
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 99efde39614..756a830ebc0 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1458,6 +1458,7 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
@@ -1701,6 +1702,7 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11)
) */;
@@ -1756,6 +1758,7 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
@@ -1845,6 +1848,7 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` int(11),
@@ -1852,11 +1856,13 @@ DROP TABLE IF EXISTS `v1`;
) */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` int(11)
) */;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
+/*!50001 DROP TABLE IF EXISTS `v3`*/;
/*!50001 CREATE TABLE `v3` (
`a` int(11),
`b` int(11),
@@ -2417,6 +2423,7 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v0`;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
+/*!50001 DROP TABLE IF EXISTS `v0`*/;
/*!50001 CREATE TABLE `v0` (
`a` int(11),
`b` varchar(32),
@@ -2424,6 +2431,7 @@ DROP TABLE IF EXISTS `v0`;
) */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` varchar(32),
@@ -2431,6 +2439,7 @@ DROP TABLE IF EXISTS `v1`;
) */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` int(11),
`b` varchar(32),
diff --git a/mysql-test/t/archive_gis.test b/mysql-test/t/archive_gis.test
index feb3fb22f00..ffbad923173 100644
--- a/mysql-test/t/archive_gis.test
+++ b/mysql-test/t/archive_gis.test
@@ -1,4 +1,3 @@
-source include/have_geometry.inc;
-source include/have_archive.inc;
+--source include/have_archive.inc
SET storage_engine=archive;
--- source include/gis_generic.inc
+--source include/gis_generic.inc
diff --git a/mysql-test/t/bdb_gis.test b/mysql-test/t/bdb_gis.test
index 76fa5d9015f..88dcbb7cbe9 100644
--- a/mysql-test/t/bdb_gis.test
+++ b/mysql-test/t/bdb_gis.test
@@ -1,4 +1,3 @@
-source include/have_geometry.inc;
-- source include/have_bdb.inc
SET storage_engine=bdb;
--source include/gis_generic.inc
diff --git a/mysql-test/t/innodb_gis.test b/mysql-test/t/innodb_gis.test
index c79e0278d16..142b526af92 100644
--- a/mysql-test/t/innodb_gis.test
+++ b/mysql-test/t/innodb_gis.test
@@ -1,4 +1,3 @@
-source include/have_geometry.inc;
--- source include/have_innodb.inc
+--source include/have_innodb.inc
SET storage_engine=innodb;
--source include/gis_generic.inc
diff --git a/mysql-test/t/ndb_gis.test b/mysql-test/t/ndb_gis.test
index f14bf546363..e14f462c32d 100644
--- a/mysql-test/t/ndb_gis.test
+++ b/mysql-test/t/ndb_gis.test
@@ -1,4 +1,3 @@
-source include/have_geometry.inc;
--source include/have_ndb.inc
SET storage_engine=ndbcluster;
--source include/gis_generic.inc
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 92d57d826a5..a5e1c37cd18 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1386,9 +1386,9 @@ double Item_func_ln::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if ((null_value=args[0]->null_value))
+ if ((null_value= args[0]->null_value))
return 0.0;
- if ((null_value= value <=0.0))
+ if (value <= 0.0)
{
signal_divide_by_null();
return 0.0;
@@ -1405,9 +1405,9 @@ double Item_func_log::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if ((null_value=args[0]->null_value))
+ if ((null_value= args[0]->null_value))
return 0.0;
- if ((null_value= value <=0.0))
+ if (value <= 0.0)
{
signal_divide_by_null();
return 0.0;
@@ -1415,9 +1415,9 @@ double Item_func_log::val_real()
if (arg_count == 2)
{
double value2= args[1]->val_real();
- if ((null_value=args[1]->null_value))
+ if ((null_value= args[1]->null_value))
return 0.0;
- if ((null_value= value2 <=0.0) || (value == 1.0))
+ if (value2 <= 0.0 || value == 1.0)
{
signal_divide_by_null();
return 0.0;
@@ -1434,7 +1434,7 @@ double Item_func_log2::val_real()
if ((null_value=args[0]->null_value))
return 0.0;
- if ((null_value= value <=0.0))
+ if (value <= 0.0)
{
signal_divide_by_null();
return 0.0;
@@ -1446,9 +1446,9 @@ double Item_func_log10::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if ((null_value=args[0]->null_value))
+ if ((null_value= args[0]->null_value))
return 0.0;
- if ((null_value= value <=0.0))
+ if (value <= 0.0)
{
signal_divide_by_null();
return 0.0;