mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
A fix (bug #6101: mysqldump writes invalid SQL).
client/mysqldump.c: A fix (bug #6101: mysqldump writes invalid SQL). Syntax corrected.
This commit is contained in:
parent
1412365a3f
commit
9c8436505d
3 changed files with 27 additions and 1 deletions
|
@ -1797,7 +1797,7 @@ static int init_dumping(char *database)
|
|||
MYSQL_ROW row;
|
||||
MYSQL_RES *dbinfo;
|
||||
|
||||
sprintf(qbuf,"SHOW CREATE DATABASE WITH IF NOT EXISTS %s",
|
||||
sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s",
|
||||
qdatabase);
|
||||
|
||||
if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock)))
|
||||
|
|
|
@ -332,3 +332,23 @@ CREATE TABLE `t1` (
|
|||
2
|
||||
3
|
||||
drop table t1;
|
||||
|
||||
/*!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 */;
|
||||
/*!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" */;
|
||||
|
||||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
|
||||
|
||||
USE `test`;
|
||||
|
||||
/*!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 */;
|
||||
|
||||
|
|
|
@ -127,3 +127,9 @@ insert into t1 values (1),(2),(3);
|
|||
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql
|
||||
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #6101: create database problem
|
||||
#
|
||||
|
||||
--exec $MYSQL_DUMP --skip-comments --databases test
|
||||
|
|
Loading…
Reference in a new issue