pscan: add DROP DATABASE

This commit is contained in:
Jeff Garzik
2019-01-05 09:38:54 -05:00
parent de88152e89
commit 20164e984d
5 changed files with 16 additions and 7 deletions

View File

@ -75,6 +75,14 @@ function parseRecordStream(recs)
}; };
stk.push(objDb); stk.push(objDb);
} else if (current.op && current.op == 'DROP-DB') {
var objDb = {
verb: 'DROP_DATABASE',
name: current.name,
if_exists: current.if_exists,
};
stk.push(objDb);
} else if (current.op && current.op == 'SELECT') { } else if (current.op && current.op == 'SELECT') {
var objSelect = { var objSelect = {
verb: 'SELECT', verb: 'SELECT',

View File

@ -1 +1 @@
CREATE DATABASE IF NOT EXISTS TheDbName; CREATE DATABASE IF NOT EXISTS tester;

4
tst-create-table.sql Normal file
View File

@ -0,0 +1,4 @@
create table if not exists tester (
name varchar(100) primary key,
age int not null
);

View File

@ -1,6 +0,0 @@
create table if not exists TheTableName (
id int(11) not null auto_increment primary key,
region varchar(32) not null,
data_size bigint not null default '0',
createtime datetime not null
);

3
tst-drop-db.sql Normal file
View File

@ -0,0 +1,3 @@
drop database if exists tester;