commit.py 91.3 KB
Newer Older
1 2 3 4 5 6 7 8 9
# -*- coding: utf-8 -*-

import sys
from util.log import *
from util.cases import *
from util.sql import *


class TDTestCase:
S
Shuduo Sang 已提交
10
    def init(self, conn, logSql):
11
        tdLog.debug("start to execute %s" % __file__)
S
Shuduo Sang 已提交
12
        tdSql.init(conn.cursor(), logSql)
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

    def run(self):
        tdSql.prepare()

        # TSIM: system sh/stop_dnodes.sh
        # TSIM:
        # TSIM:
        # TSIM: system sh/deploy.sh -n dnode1 -i 1
        # TSIM: system sh/cfg.sh -n dnode1 -c walLevel -v 0
        # TSIM: system sh/exec.sh -n dnode1 -s start
        # TSIM:
        # TSIM: sleep 3000
        # TSIM: sql connect
        # TSIM:
        # TSIM: print ======================== dnode1 start
        tdLog.info('======================== dnode1 start')
        # TSIM:
        # TSIM: $dbPrefix = db
        # TSIM: $tbPrefix = tb
        tbPrefix = "tb"
        # TSIM: $mtPrefix = mt
        mtPrefix = "mt"
        # TSIM: $tbNum = 10
        tbNum = 10
        # TSIM: $rowNum = 20
        rowNum = 20
        # TSIM: $totalNum = 200
        totalNum = 200
        # TSIM:
        # TSIM: print =============== step1
        tdLog.info('=============== step1')
        # TSIM: $i = 0
        i = 0
        # TSIM: $db = $dbPrefix . $i
        # TSIM:
        # TSIM: sql create database $db
        # TSIM: sql use $db
        # TSIM:
        # TSIM: print =============== step2
        tdLog.info('=============== step2')
        # TSIM: $i = 2
        i = 2
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # bool, tgcol2 int)
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int)' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int)' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2 )
        tdLog.info('create table %s using %s tags( 1, 2 )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, 2 )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol2 = 2
        tdLog.info('select * from %s where tgcol2 = 2' % (mt))
        tdSql.query('select * from %s where tgcol2 = 2' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
80
        # TSIM: endi
81 82 83 84
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
85
        # TSIM: endi
86 87 88 89
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
90
        # TSIM: endi
91 92 93 94
        # TSIM: if $data03 != 2 then
        tdLog.info('tdSql.checkData(0, 3, 2)')
        tdSql.checkData(0, 3, 2)
        # TSIM: return -1
95
        # TSIM: endi
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt add tag tgcol4 int
        tdLog.info('alter table %s add tag tgcol4 int' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 int' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4 =4
        tdLog.info('alter table %s set tag tgcol4 =4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4 =4' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
122
        # TSIM: endi
123 124 125 126
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
127
        # TSIM: endi
128 129 130 131
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
132
        # TSIM: endi
133 134 135 136
        # TSIM: if $data03 != 4 then
        tdLog.info('tdSql.checkData(0, 3, 4)')
        tdSql.checkData(0, 3, 4)
        # TSIM: return -1
137
        # TSIM: endi
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step2
        tdLog.info('select * from %s where tgcol2 = 1 -x step2' % (mt))
        tdSql.error('select * from %s where tgcol2 = 1' % (mt))
        # TSIM: return -1
        # TSIM: step2:
        # TSIM:
        # TSIM: print =============== step3
        tdLog.info('=============== step3')
        # TSIM: $i = 3
        i = 3
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # smallint, tgcol2 tinyint)
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint)' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint)' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2 )
        tdLog.info('create table %s using %s tags( 1, 2 )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, 2 )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol2 = 2
        tdLog.info('select * from %s where tgcol2 = 2' % (mt))
        tdSql.query('select * from %s where tgcol2 = 2' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
174
        # TSIM: endi
175 176 177 178
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
179
        # TSIM: endi
180 181 182 183
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
184
        # TSIM: endi
185 186 187 188
        # TSIM: if $data03 != 2 then
        tdLog.info('tdSql.checkData(0, 3, 2)')
        tdSql.checkData(0, 3, 2)
        # TSIM: return -1
189
        # TSIM: endi
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt add tag tgcol4 tinyint
        tdLog.info('alter table %s add tag tgcol4 tinyint' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 tinyint' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
216
        # TSIM: endi
217 218 219 220
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
221
        # TSIM: endi
222 223 224 225
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
226
        # TSIM: endi
227 228 229 230
        # TSIM: if $data03 != 4 then
        tdLog.info('tdSql.checkData(0, 3, 4)')
        tdSql.checkData(0, 3, 4)
        # TSIM: return -1
231
        # TSIM: endi
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step3
        tdLog.info('select * from %s where tgcol2 = 1 -x step3' % (mt))
        tdSql.error('select * from %s where tgcol2 = 1' % (mt))
        # TSIM: return -1
        # TSIM: step3:
        # TSIM:
        # TSIM: print =============== step4
        tdLog.info('=============== step4')
        # TSIM: $i = 4
        i = 4
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # bigint, tgcol2 float)
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float)' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float)' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2 )
        tdLog.info('create table %s using %s tags( 1, 2 )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, 2 )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol2 = 2
        tdLog.info('select * from %s where tgcol2 = 2' % (mt))
        tdSql.query('select * from %s where tgcol2 = 2' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
268
        # TSIM: endi
269 270 271 272
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
273
        # TSIM: endi
274 275 276 277
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
278
        # TSIM: endi
279 280 281 282
        # TSIM: if $data03 != 2.00000 then
        tdLog.info('tdSql.checkData(0, 3, 2.00000)')
        tdSql.checkData(0, 3, 2.00000)
        # TSIM: return -1
283
        # TSIM: endi
284 285 286 287 288 289 290 291
        # TSIM:
        # TSIM: sql describe $tb
        tdLog.info('describe %s' % (tb))
        tdSql.query('describe %s' % (tb))
        # TSIM: if $data21 != BIGINT then
        tdLog.info('tdSql.checkDataType(2, 1, "BIGINT")')
        tdSql.checkDataType(2, 1, "BIGINT")
        # TSIM: return -1
292
        # TSIM: endi
293 294 295 296
        # TSIM: if $data31 != FLOAT then
        tdLog.info('tdSql.checkDataType(3, 1, "FLOAT")')
        tdSql.checkDataType(3, 1, "FLOAT")
        # TSIM: return -1
297
        # TSIM: endi
298
        # TSIM: if $data23 != 1 then
S
Shuduo Sang 已提交
299 300
        tdLog.info('tdSql.checkData(2, 3, "TAG")')
        tdSql.checkData(2, 3, "TAG")
301
        # TSIM: return -1
302
        # TSIM: endi
303
        # TSIM: if $data33 != 2.000000 then
S
Shuduo Sang 已提交
304 305
        tdLog.info('tdSql.checkData(3, 3, "TAG")')
        tdSql.checkData(3, 3, "TAG")
306
        # TSIM: return -1
307
        # TSIM: endi
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt add tag tgcol4 float
        tdLog.info('alter table %s add tag tgcol4 float' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 float' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
334
        # TSIM: endi
335 336 337 338
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
339
        # TSIM: endi
340 341 342 343
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
344
        # TSIM: endi
345 346 347 348
        # TSIM: if $data03 != 4.00000 then
        tdLog.info('tdSql.checkData(0, 3, 4.00000)')
        tdSql.checkData(0, 3, 4.00000)
        # TSIM: return -1
349
        # TSIM: endi
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step4
        tdLog.info('select * from %s where tgcol2 = 1 -x step4' % (mt))
        tdSql.error('select * from %s where tgcol2 = 1' % (mt))
        # TSIM: return -1
        # TSIM: step4:
        # TSIM:
        # TSIM: print =============== step5
        tdLog.info('=============== step5')
        # TSIM: $i = 5
        i = 5
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # double, tgcol2 binary(10))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, '2' )
        tdLog.info('create table %s using %s tags( 1, "2" )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, "2" )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol2 = '2'
        tdLog.info('select * from %s where tgcol2 = "2"' % (mt))
        tdSql.query('select * from %s where tgcol2 = "2"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
386
        # TSIM: endi
387 388 389 390
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
391
        # TSIM: endi
392 393 394 395
        # TSIM: if $data02 != 1.000000000 then
        tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
        tdSql.checkData(0, 2, 1.000000000)
        # TSIM: return -1
396
        # TSIM: endi
397
        # TSIM: if $data03 != 2 then
S
Shuduo Sang 已提交
398 399
        tdLog.info('tdSql.checkData(0, 3, "2")')
        tdSql.checkData(0, 3, "2")
400
        # TSIM: return -1
401
        # TSIM: endi
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt add tag tgcol4 smallint
        tdLog.info('alter table %s add tag tgcol4 smallint' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 smallint' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
428
        # TSIM: endi
429 430 431 432
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
433
        # TSIM: endi
434 435 436 437
        # TSIM: if $data02 != 1.000000000 then
        tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
        tdSql.checkData(0, 2, 1.000000000)
        # TSIM: return -1
438
        # TSIM: endi
439 440 441 442
        # TSIM: if $data03 != 4 then
        tdLog.info('tdSql.checkData(0, 3, 4)')
        tdSql.checkData(0, 3, 4)
        # TSIM: return -1
443
        # TSIM: endi
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
        # TSIM:
        # TSIM: sql select * from $mt where tgcol3 = '1' -x step5
        tdLog.info('select * from %s where tgcol3 = "1" -x step5' % (mt))
        tdSql.error('select * from %s where tgcol3 = "1"' % (mt))
        # TSIM: return -1
        # TSIM: step5:
        # TSIM:
        # TSIM: print =============== step6
        tdLog.info('=============== step6')
        # TSIM: $i = 6
        i = 6
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # bool, tgcol2 int, tgcol3 tinyint)
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 tinyint)' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 tinyint)' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2, 3 )
        tdLog.info('create table %s using %s tags( 1, 2, 3 )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, 2, 3 )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol2 = 2
        tdLog.info('select * from %s where tgcol2 = 2' % (mt))
        tdSql.query('select * from %s where tgcol2 = 2' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
480
        # TSIM: endi
481 482 483 484
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
485
        # TSIM: endi
486 487 488 489
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
490
        # TSIM: endi
491 492 493 494
        # TSIM: if $data03 != 2 then
        tdLog.info('tdSql.checkData(0, 3, 2)')
        tdSql.checkData(0, 3, 2)
        # TSIM: return -1
495
        # TSIM: endi
496 497 498 499
        # TSIM: if $data04 != 3 then
        tdLog.info('tdSql.checkData(0, 4, 3)')
        tdSql.checkData(0, 4, 3)
        # TSIM: return -1
500
        # TSIM: endi
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542
        # TSIM:
        # TSIM: sql alter table $mt change tag tgcol1 tgcol4
        tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
        tdSql.execute('alter table %s change tag tgcol1 tgcol4' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol3
        tdLog.info('alter table %s drop tag tgcol3' % (mt))
        tdSql.execute('alter table %s drop tag tgcol3' % (mt))
        # TSIM: sql alter table $mt add tag tgcol5 binary(10)
        tdLog.info('alter table %s add tag tgcol5 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol5 binary(10)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol6 binary(10)
        tdLog.info('alter table %s add tag tgcol6 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol6 binary(10)' % (mt))
        # TSIM:
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=false
        tdLog.info('alter table %s set tag tgcol4=false' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=false' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=5
        tdLog.info('alter table %s set tag tgcol5=5' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=5' % (tb))
        # TSIM: sql alter table $tb set tag tgcol6=6
        tdLog.info('alter table %s set tag tgcol6=6' % (tb))
        tdSql.execute('alter table %s set tag tgcol6=6' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = '5'
        tdLog.info('select * from %s where tgcol5 = "5"' % (mt))
        tdSql.query('select * from %s where tgcol5 = "5"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
543
        # TSIM: endi
544 545 546 547
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
548
        # TSIM: endi
549 550 551 552
        # TSIM: if $data02 != 0 then
        tdLog.info('tdSql.checkData(0, 2, 0)')
        tdSql.checkData(0, 2, 0)
        # TSIM: return -1
553
        # TSIM: endi
554
        # TSIM: if $data03 != 5 then
S
Shuduo Sang 已提交
555 556
        tdLog.info('tdSql.checkData(0, 3, "5")')
        tdSql.checkData(0, 3, "5")
557
        # TSIM: return -1
558
        # TSIM: endi
559
        # TSIM: if $data04 != 6 then
S
Shuduo Sang 已提交
560 561
        tdLog.info('tdSql.checkData(0, 4, "6")')
        tdSql.checkData(0, 4, "6")
562
        # TSIM: return -1
563
        # TSIM: endi
564 565 566 567 568 569 570 571 572 573
        # TSIM:
        # TSIM: sql select * from $mt where tgcol6 = '6'
        tdLog.info('select * from %s where tgcol6 = "6"' % (mt))
        tdSql.query('select * from %s where tgcol6 = "6"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
574
        # TSIM: endi
575 576 577 578
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
579
        # TSIM: endi
580 581 582 583
        # TSIM: if $data02 != 0 then
        tdLog.info('tdSql.checkData(0, 2, 0)')
        tdSql.checkData(0, 2, 0)
        # TSIM: return -1
584
        # TSIM: endi
585
        # TSIM: if $data03 != 5 then
S
Shuduo Sang 已提交
586 587
        tdLog.info('tdSql.checkData(0, 3, "5")')
        tdSql.checkData(0, 3, "5")
588
        # TSIM: return -1
589
        # TSIM: endi
590
        # TSIM: if $data04 != 6 then
S
Shuduo Sang 已提交
591 592
        tdLog.info('tdSql.checkData(0, 4, "6")')
        tdSql.checkData(0, 4, "6")
593
        # TSIM: return -1
594
        # TSIM: endi
595 596 597 598 599 600 601 602
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 1
        tdLog.info('select * from %s where tgcol4 = 1' % (mt))
        tdSql.query('select * from %s where tgcol4 = 1' % (mt))
        # TSIM: if $rows != 0 then
        tdLog.info('tdSql.checkRow(0)')
        tdSql.checkRows(0)
        # TSIM: return -1
603
        # TSIM: endi
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638
        # TSIM: sql select * from $mt where tgcol3 = 1 -x step52
        tdLog.info('select * from %s where tgcol3 = 1 -x step52' % (mt))
        tdSql.error('select * from %s where tgcol3 = 12' % (mt))
        # TSIM: return -1
        # TSIM: step52:
        # TSIM:
        # TSIM: print =============== step7
        tdLog.info('=============== step7')
        # TSIM: $i = 7
        i = 7
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # smallint, tgcol2 tinyint, tgcol3 binary(10))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint, tgcol3 binary(10))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint, tgcol3 binary(10))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2, '3' )
        tdLog.info('create table %s using %s tags( 1, 2, "3" )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, 2, "3" )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol3 = '3'
        tdLog.info('select * from %s where tgcol3 = "3"' % (mt))
        tdSql.query('select * from %s where tgcol3 = "3"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
639
        # TSIM: endi
640 641 642 643
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
644
        # TSIM: endi
645 646 647 648
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
649
        # TSIM: endi
650 651 652 653
        # TSIM: if $data03 != 2 then
        tdLog.info('tdSql.checkData(0, 3, 2)')
        tdSql.checkData(0, 3, 2)
        # TSIM: return -1
654
        # TSIM: endi
655
        # TSIM: if $data04 != 3 then
S
Shuduo Sang 已提交
656 657
        tdLog.info('tdSql.checkData(0, 4, "3")')
        tdSql.checkData(0, 4, "3")
658
        # TSIM: return -1
659
        # TSIM: endi
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701
        # TSIM:
        # TSIM: sql alter table $mt change tag tgcol1 tgcol4
        tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
        tdSql.execute('alter table %s change tag tgcol1 tgcol4' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol3
        tdLog.info('alter table %s drop tag tgcol3' % (mt))
        tdSql.execute('alter table %s drop tag tgcol3' % (mt))
        # TSIM: sql alter table $mt add tag tgcol5 bigint
        tdLog.info('alter table %s add tag tgcol5 bigint' % (mt))
        tdSql.execute('alter table %s add tag tgcol5 bigint' % (mt))
        # TSIM: sql alter table $mt add tag tgcol6 tinyint
        tdLog.info('alter table %s add tag tgcol6 tinyint' % (mt))
        tdSql.execute('alter table %s add tag tgcol6 tinyint' % (mt))
        # TSIM:
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=5
        tdLog.info('alter table %s set tag tgcol5=5' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=5' % (tb))
        # TSIM: sql alter table $tb set tag tgcol6=6
        tdLog.info('alter table %s set tag tgcol6=6' % (tb))
        tdSql.execute('alter table %s set tag tgcol6=6' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol6 = 6
        tdLog.info('select * from %s where tgcol6 = 6' % (mt))
        tdSql.query('select * from %s where tgcol6 = 6' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
702
        # TSIM: endi
703 704 705 706
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
707
        # TSIM: endi
708 709 710 711
        # TSIM: if $data02 != 4 then
        tdLog.info('tdSql.checkData(0, 2, 4)')
        tdSql.checkData(0, 2, 4)
        # TSIM: return -1
712
        # TSIM: endi
713 714 715 716
        # TSIM: if $data03 != 5 then
        tdLog.info('tdSql.checkData(0, 3, 5)')
        tdSql.checkData(0, 3, 5)
        # TSIM: return -1
717
        # TSIM: endi
718 719 720 721
        # TSIM: if $data04 != 6 then
        tdLog.info('tdSql.checkData(0, 4, 6)')
        tdSql.checkData(0, 4, 6)
        # TSIM: return -1
722
        # TSIM: endi
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step71
        tdLog.info('select * from %s where tgcol2 = 1 -x step71' % (mt))
        tdSql.error('select * from %s where tgcol2 = 11' % (mt))
        # TSIM: return -1
        # TSIM: step71:
        # TSIM: sql select * from $mt where tgcol3 = 1 -x step72
        tdLog.info('select * from %s where tgcol3 = 1 -x step72' % (mt))
        tdSql.error('select * from %s where tgcol3 = 12' % (mt))
        # TSIM: return -1
        # TSIM: step72:
        # TSIM:
        # TSIM: print =============== step8
        tdLog.info('=============== step8')
        # TSIM: $i = 8
        i = 8
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # bigint, tgcol2 float, tgcol3 binary(10))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float, tgcol3 binary(10))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float, tgcol3 binary(10))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2, '3' )
        tdLog.info('create table %s using %s tags( 1, 2, "3" )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, 2, "3" )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol3 = '3'
        tdLog.info('select * from %s where tgcol3 = "3"' % (mt))
        tdSql.query('select * from %s where tgcol3 = "3"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
764
        # TSIM: endi
765 766 767 768
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
769
        # TSIM: endi
770 771 772 773
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
774
        # TSIM: endi
775 776 777 778
        # TSIM: if $data03 != 2.00000 then
        tdLog.info('tdSql.checkData(0, 3, 2.00000)')
        tdSql.checkData(0, 3, 2.00000)
        # TSIM: return -1
779
        # TSIM: endi
780
        # TSIM: if $data04 != 3 then
S
Shuduo Sang 已提交
781 782
        tdLog.info('tdSql.checkData(0, 4, "3")')
        tdSql.checkData(0, 4, "3")
783
        # TSIM: return -1
784
        # TSIM: endi
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
        # TSIM:
        # TSIM: sql alter table $mt change tag tgcol1 tgcol4
        tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
        tdSql.execute('alter table %s change tag tgcol1 tgcol4' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol3
        tdLog.info('alter table %s drop tag tgcol3' % (mt))
        tdSql.execute('alter table %s drop tag tgcol3' % (mt))
        # TSIM: sql alter table $mt add tag tgcol5 binary(17)
        tdLog.info('alter table %s add tag tgcol5 binary(17)' % (mt))
        tdSql.execute('alter table %s add tag tgcol5 binary(17)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol6 bool
        tdLog.info('alter table %s add tag tgcol6 bool' % (mt))
        tdSql.execute('alter table %s add tag tgcol6 bool' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=5
        tdLog.info('alter table %s set tag tgcol5=5' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=5' % (tb))
        # TSIM: sql alter table $tb set tag tgcol6=1
        tdLog.info('alter table %s set tag tgcol6=1' % (tb))
        tdSql.execute('alter table %s set tag tgcol6=1' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = '5'
        tdLog.info('select * from %s where tgcol5 = "5"' % (mt))
        tdSql.query('select * from %s where tgcol5 = "5"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
826
        # TSIM: endi
827 828 829 830
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
831
        # TSIM: endi
832 833 834 835
        # TSIM: if $data02 != 4 then
        tdLog.info('tdSql.checkData(0, 2, 4)')
        tdSql.checkData(0, 2, 4)
        # TSIM: return -1
836
        # TSIM: endi
837
        # TSIM: if $data03 != 5 then
S
Shuduo Sang 已提交
838 839
        tdLog.info('tdSql.checkData(0, 3, "5")')
        tdSql.checkData(0, 3, "5")
840
        # TSIM: return -1
841
        # TSIM: endi
842 843 844 845
        # TSIM: if $data04 != 1 then
        tdLog.info('tdSql.checkData(0, 4, 1)')
        tdSql.checkData(0, 4, 1)
        # TSIM: return -1
846
        # TSIM: endi
847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step81
        tdLog.info('select * from %s where tgcol2 = 1 -x step81' % (mt))
        tdSql.error('select * from %s where tgcol2 = 11' % (mt))
        # TSIM: return -1
        # TSIM: step81:
        # TSIM: sql select * from $mt where tgcol3 = 1 -x step82
        tdLog.info('select * from %s where tgcol3 = 1 -x step82' % (mt))
        tdSql.error('select * from %s where tgcol3 = 12' % (mt))
        # TSIM: return -1
        # TSIM: step82:
        # TSIM:
        # TSIM: print =============== step9
        tdLog.info('=============== step9')
        # TSIM: $i = 9
        i = 9
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # double, tgcol2 binary(10), tgcol3 binary(10))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2, '3' )
        tdLog.info('create table %s using %s tags( 1, 2, "3" )' % (tb, mt))
        tdSql.execute('create table %s using %s tags( 1, 2, "3" )' % (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol2 = '2'
        tdLog.info('select * from %s where tgcol2 = "2"' % (mt))
        tdSql.query('select * from %s where tgcol2 = "2"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
888
        # TSIM: endi
889 890 891 892
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
893
        # TSIM: endi
894 895 896 897
        # TSIM: if $data02 != 1.000000000 then
        tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
        tdSql.checkData(0, 2, 1.000000000)
        # TSIM: return -1
898
        # TSIM: endi
899
        # TSIM: if $data03 != 2 then
S
Shuduo Sang 已提交
900 901
        tdLog.info('tdSql.checkData(0, 3, "2")')
        tdSql.checkData(0, 3, "2")
902
        # TSIM: return -1
903
        # TSIM: endi
904
        # TSIM: if $data04 != 3 then
S
Shuduo Sang 已提交
905 906
        tdLog.info('tdSql.checkData(0, 4, "3")')
        tdSql.checkData(0, 4, "3")
907
        # TSIM: return -1
908
        # TSIM: endi
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950
        # TSIM:
        # TSIM: sql alter table $mt change tag tgcol1 tgcol4
        tdLog.info('alter table %s change tag tgcol1 tgcol4' % (mt))
        tdSql.execute('alter table %s change tag tgcol1 tgcol4' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol3
        tdLog.info('alter table %s drop tag tgcol3' % (mt))
        tdSql.execute('alter table %s drop tag tgcol3' % (mt))
        # TSIM: sql alter table $mt add tag tgcol5 bool
        tdLog.info('alter table %s add tag tgcol5 bool' % (mt))
        tdSql.execute('alter table %s add tag tgcol5 bool' % (mt))
        # TSIM: sql alter table $mt add tag tgcol6 float
        tdLog.info('alter table %s add tag tgcol6 float' % (mt))
        tdSql.execute('alter table %s add tag tgcol6 float' % (mt))
        # TSIM:
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=1
        tdLog.info('alter table %s set tag tgcol5=1' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=1' % (tb))
        # TSIM: sql alter table $tb set tag tgcol6=6
        tdLog.info('alter table %s set tag tgcol6=6' % (tb))
        tdSql.execute('alter table %s set tag tgcol6=6' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = 1
        tdLog.info('select * from %s where tgcol5 = 1' % (mt))
        tdSql.query('select * from %s where tgcol5 = 1' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
951
        # TSIM: endi
952 953 954 955
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
956
        # TSIM: endi
957 958 959 960
        # TSIM: if $data02 != 4.000000000 then
        tdLog.info('tdSql.checkData(0, 2, 4.000000000)')
        tdSql.checkData(0, 2, 4.000000000)
        # TSIM: return -1
961
        # TSIM: endi
962 963 964 965
        # TSIM: if $data03 != 1 then
        tdLog.info('tdSql.checkData(0, 3, 1)')
        tdSql.checkData(0, 3, 1)
        # TSIM: return -1
966
        # TSIM: endi
967 968 969 970
        # TSIM: if $data04 != 6.00000 then
        tdLog.info('tdSql.checkData(0, 4, 6.00000)')
        tdSql.checkData(0, 4, 6.00000)
        # TSIM: return -1
971
        # TSIM: endi
972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
        # TSIM:
        # TSIM: sql select * from $mt where tgcol3 = 1 -x step91
        tdLog.info('select * from %s where tgcol3 = 1 -x step91' % (mt))
        tdSql.error('select * from %s where tgcol3 = 11' % (mt))
        # TSIM: return -1
        # TSIM: step91:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step92
        tdLog.info('select * from %s where tgcol2 = 1 -x step92' % (mt))
        tdSql.error('select * from %s where tgcol2 = 12' % (mt))
        # TSIM: return -1
        # TSIM: step92:
        # TSIM:
        # TSIM: print =============== step10
        tdLog.info('=============== step10')
        # TSIM: $i = 10
        i = 10
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( '1', '2', '3', '4' )
        tdLog.info(
            'create table %s using %s tags( "1", "2", "3", "4" )' %
            (tb, mt))
        tdSql.execute(
            'create table %s using %s tags( "1", "2", "3", "4" )' %
            (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol4 = '4'
        tdLog.info('select * from %s where tgcol4 = "4"' % (mt))
        tdSql.query('select * from %s where tgcol4 = "4"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1017
        # TSIM: endi
1018 1019 1020 1021
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1022
        # TSIM: endi
1023
        # TSIM: if $data02 != 1 then
S
Shuduo Sang 已提交
1024 1025
        tdLog.info('tdSql.checkData(0, 2, "1")')
        tdSql.checkData(0, 2, "1")
1026
        # TSIM: return -1
1027
        # TSIM: endi
1028
        # TSIM: if $data03 != 2 then
S
Shuduo Sang 已提交
1029 1030
        tdLog.info('tdSql.checkData(0, 3, "2")')
        tdSql.checkData(0, 3, "2")
1031
        # TSIM: return -1
1032
        # TSIM: endi
1033
        # TSIM: if $data04 != 3 then
S
Shuduo Sang 已提交
1034 1035
        tdLog.info('tdSql.checkData(0, 4, "3")')
        tdSql.checkData(0, 4, "3")
1036
        # TSIM: return -1
1037
        # TSIM: endi
1038
        # TSIM: if $data05 != 4 then
S
Shuduo Sang 已提交
1039 1040
        tdLog.info('tdSql.checkData(0, 5, "4")')
        tdSql.checkData(0, 5, "4")
1041
        # TSIM: return -1
1042
        # TSIM: endi
1043 1044 1045
        # TSIM:
        # TSIM: sql alter table $mt change tag tgcol1 tgcol4 -x step103
        tdLog.info('alter table %s change tag tgcol1 tgcol4 -x step103' % (mt))
S
Shuduo Sang 已提交
1046
        tdSql.error('alter table %s change tag tgcol1 tgcol4' % (mt))
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090
        # TSIM: return -1
        # TSIM: step103:
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol3
        tdLog.info('alter table %s drop tag tgcol3' % (mt))
        tdSql.execute('alter table %s drop tag tgcol3' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol4
        tdLog.info('alter table %s drop tag tgcol4' % (mt))
        tdSql.execute('alter table %s drop tag tgcol4' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $mt add tag tgcol4 binary(10)
        tdLog.info('alter table %s add tag tgcol4 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 binary(10)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol5 bool
        tdLog.info('alter table %s add tag tgcol5 bool' % (mt))
        tdSql.execute('alter table %s add tag tgcol5 bool' % (mt))
        # TSIM:
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=false
        tdLog.info('alter table %s set tag tgcol5=false' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=false' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = '4'
        tdLog.info('select * from %s where tgcol4 = "4"' % (mt))
        tdSql.query('select * from %s where tgcol4 = "4"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1091
        # TSIM: endi
1092 1093 1094 1095
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1096
        # TSIM: endi
1097
        # TSIM: if $data02 != 1 then
S
Shuduo Sang 已提交
1098 1099
        tdLog.info('tdSql.checkData(0, 2, "1")')
        tdSql.checkData(0, 2, "1")
1100
        # TSIM: return -1
1101
        # TSIM: endi
1102
        # TSIM: if $data03 != 4 then
S
Shuduo Sang 已提交
1103 1104
        tdLog.info('tdSql.checkData(0, 3, "4")')
        tdSql.checkData(0, 3, "4")
1105
        # TSIM: return -1
1106
        # TSIM: endi
1107 1108 1109 1110
        # TSIM: if $data04 != 0 then
        tdLog.info('tdSql.checkData(0, 4, 0)')
        tdSql.checkData(0, 4, 0)
        # TSIM: return -1
1111
        # TSIM: endi
1112 1113
        # TSIM: if $data05 != NULL then
        tdLog.info('tdSql.checkData(0, 5, NULL)')
S
Shuduo Sang 已提交
1114 1115 1116 1117 1118
        try:
            tdSql.checkData(0, 5, None)
        except Exception as e:
            tdLog.info(repr(e))
            tdLog.info("out of range")
1119
        # TSIM: return -1
1120
        # TSIM: endi
1121 1122 1123
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step101
        tdLog.info('select * from %s where tgcol2 = 1 -x step101' % (mt))
S
Shuduo Sang 已提交
1124
        tdSql.error('select * from %s where tgcol2 = 1' % (mt))
1125 1126 1127 1128
        # TSIM: return -1
        # TSIM: step101:
        # TSIM: sql select * from $mt where tgcol3 = 1 -x step102
        tdLog.info('select * from %s where tgcol3 = 1 -x step102' % (mt))
S
Shuduo Sang 已提交
1129
        tdSql.error('select * from %s where tgcol3 = 1' % (mt))
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165
        # TSIM: return -1
        # TSIM: step102:
        # TSIM:
        # TSIM: print =============== step11
        tdLog.info('=============== step11')
        # TSIM: $i = 11
        i = 11
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2, 3, 4, '5' )
        tdLog.info(
            'create table %s using %s tags( 1, 2, 3, 4, "5" )' %
            (tb, mt))
        tdSql.execute(
            'create table %s using %s tags( 1, 2, 3, 4, "5" )' %
            (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol1 = 1
        tdLog.info('select * from %s where tgcol1 = 1' % (mt))
        tdSql.query('select * from %s where tgcol1 = 1' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1166
        # TSIM: endi
1167 1168 1169 1170
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1171
        # TSIM: endi
1172 1173 1174 1175
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
1176
        # TSIM: endi
1177 1178 1179 1180
        # TSIM: if $data03 != 2 then
        tdLog.info('tdSql.checkData(0, 3, 2)')
        tdSql.checkData(0, 3, 2)
        # TSIM: return -1
1181
        # TSIM: endi
1182 1183 1184 1185
        # TSIM: if $data04 != 3 then
        tdLog.info('tdSql.checkData(0, 4, 3)')
        tdSql.checkData(0, 4, 3)
        # TSIM: return -1
1186
        # TSIM: endi
1187 1188 1189 1190
        # TSIM: if $data05 != 4.00000 then
        tdLog.info('tdSql.checkData(0, 5, 4.00000)')
        tdSql.checkData(0, 5, 4.00000)
        # TSIM: return -1
1191
        # TSIM: endi
1192
        # TSIM: if $data06 != 5 then
S
Shuduo Sang 已提交
1193 1194
        tdLog.info('tdSql.checkData(0, 6, "5")')
        tdSql.checkData(0, 6, "5")
1195
        # TSIM: return -1
1196
        # TSIM: endi
1197 1198 1199
        # TSIM:
        # TSIM: sql alter table $mt change tag tgcol1 tgcol4 -x step114
        tdLog.info('alter table %s change tag tgcol1 tgcol4 -x step114' % (mt))
S
Shuduo Sang 已提交
1200
        tdSql.error('alter table %s change tag tgcol1 tgcol4' % (mt))
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
        # TSIM: return -1
        # TSIM: step114:
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol3
        tdLog.info('alter table %s drop tag tgcol3' % (mt))
        tdSql.execute('alter table %s drop tag tgcol3' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol4
        tdLog.info('alter table %s drop tag tgcol4' % (mt))
        tdSql.execute('alter table %s drop tag tgcol4' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol5
        tdLog.info('alter table %s drop tag tgcol5' % (mt))
        tdSql.execute('alter table %s drop tag tgcol5' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $mt add tag tgcol4 binary(10)
        tdLog.info('alter table %s add tag tgcol4 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 binary(10)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol5 int
        tdLog.info('alter table %s add tag tgcol5 int' % (mt))
        tdSql.execute('alter table %s add tag tgcol5 int' % (mt))
        # TSIM: sql alter table $mt add tag tgcol6 binary(10)
        tdLog.info('alter table %s add tag tgcol6 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol6 binary(10)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol7 bigint
        tdLog.info('alter table %s add tag tgcol7 bigint' % (mt))
        tdSql.execute('alter table %s add tag tgcol7 bigint' % (mt))
        # TSIM: sql alter table $mt add tag tgcol8 smallint
        tdLog.info('alter table %s add tag tgcol8 smallint' % (mt))
        tdSql.execute('alter table %s add tag tgcol8 smallint' % (mt))
        # TSIM:
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol4=4
        tdLog.info('alter table %s set tag tgcol4=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=4' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=5
        tdLog.info('alter table %s set tag tgcol5=5' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=5' % (tb))
        # TSIM: sql alter table $tb set tag tgcol6=6
        tdLog.info('alter table %s set tag tgcol6=6' % (tb))
        tdSql.execute('alter table %s set tag tgcol6=6' % (tb))
        # TSIM: sql alter table $tb set tag tgcol7=7
        tdLog.info('alter table %s set tag tgcol7=7' % (tb))
        tdSql.execute('alter table %s set tag tgcol7=7' % (tb))
        # TSIM: sql alter table $tb set tag tgcol8=8
        tdLog.info('alter table %s set tag tgcol8=8' % (tb))
        tdSql.execute('alter table %s set tag tgcol8=8' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 =5
        tdLog.info('select * from %s where tgcol5 =5' % (mt))
        tdSql.query('select * from %s where tgcol5 =5' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1266
        # TSIM: endi
1267 1268 1269 1270
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1271
        # TSIM: endi
1272 1273 1274 1275
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
1276
        # TSIM: endi
1277
        # TSIM: if $data03 != 4 then
S
Shuduo Sang 已提交
1278 1279
        tdLog.info('tdSql.checkData(0, 3, "4")')
        tdSql.checkData(0, 3, "4")
1280
        # TSIM: return -1
1281
        # TSIM: endi
1282 1283 1284 1285
        # TSIM: if $data04 != 5 then
        tdLog.info('tdSql.checkData(0, 4, 5)')
        tdSql.checkData(0, 4, 5)
        # TSIM: return -1
1286
        # TSIM: endi
1287
        # TSIM: if $data05 != 6 then
S
Shuduo Sang 已提交
1288 1289
        tdLog.info('tdSql.checkData(0, 5, "6")')
        tdSql.checkData(0, 5, "6")
1290
        # TSIM: return -1
1291
        # TSIM: endi
1292 1293 1294 1295
        # TSIM: if $data06 != 7 then
        tdLog.info('tdSql.checkData(0, 6, 7)')
        tdSql.checkData(0, 6, 7)
        # TSIM: return -1
1296
        # TSIM: endi
1297 1298 1299 1300
        # TSIM: if $data07 != 8 then
        tdLog.info('tdSql.checkData(0, 7, 8)')
        tdSql.checkData(0, 7, 8)
        # TSIM: return -1
1301
        # TSIM: endi
1302 1303 1304
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = 1 -x step111
        tdLog.info('select * from %s where tgcol2 = 1 -x step111' % (mt))
S
Shuduo Sang 已提交
1305
        tdSql.error('select * from %s where tgcol2 = 1' % (mt))
1306 1307 1308 1309
        # TSIM: return -1
        # TSIM: step111:
        # TSIM: sql select * from $mt where tgcol3 = 1 -x step112
        tdLog.info('select * from %s where tgcol3 = 1 -x step112' % (mt))
S
Shuduo Sang 已提交
1310
        tdSql.error('select * from %s where tgcol3 = 1' % (mt))
1311 1312 1313 1314
        # TSIM: return -1
        # TSIM: step112:
        # TSIM: sql select * from $mt where tgcol9 = 1 -x step113
        tdLog.info('select * from %s where tgcol9 = 1 -x step113' % (mt))
S
Shuduo Sang 已提交
1315
        tdSql.error('select * from %s where tgcol9 = 1' % (mt))
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352
        # TSIM: return -1
        # TSIM: step113:
        # TSIM:
        # TSIM: print =============== step12
        tdLog.info('=============== step12')
        # TSIM: $i = 12
        i = 12
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5
        # binary(10), tgcol6 binary(20))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(20))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(20))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' )
        tdLog.info(
            'create table %s using %s tags( 1, 2, 3, 4, "5", "6" )' %
            (tb, mt))
        tdSql.execute(
            'create table %s using %s tags( 1, 2, 3, 4, "5", "6" )' %
            (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol1 = 1
        tdLog.info('select * from %s where tgcol1 = 1' % (mt))
        tdSql.query('select * from %s where tgcol1 = 1' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1353
        # TSIM: endi
1354 1355 1356 1357
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1358
        # TSIM: endi
1359 1360 1361 1362
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
1363
        # TSIM: endi
1364 1365 1366 1367
        # TSIM: if $data03 != 2 then
        tdLog.info('tdSql.checkData(0, 3, 2)')
        tdSql.checkData(0, 3, 2)
        # TSIM: return -1
1368
        # TSIM: endi
1369 1370 1371 1372
        # TSIM: if $data04 != 3.00000 then
        tdLog.info('tdSql.checkData(0, 4, 3.00000)')
        tdSql.checkData(0, 4, 3.00000)
        # TSIM: return -1
1373
        # TSIM: endi
1374 1375 1376 1377
        # TSIM: if $data05 != 4.000000000 then
        tdLog.info('tdSql.checkData(0, 5, 4.000000000)')
        tdSql.checkData(0, 5, 4.000000000)
        # TSIM: return -1
1378
        # TSIM: endi
1379
        # TSIM: if $data06 != 5 then
S
Shuduo Sang 已提交
1380 1381
        tdLog.info('tdSql.checkData(0, 6, "5")')
        tdSql.checkData(0, 6, "5")
1382
        # TSIM: return -1
1383
        # TSIM: endi
1384
        # TSIM: if $data07 != 6 then
S
Shuduo Sang 已提交
1385 1386
        tdLog.info('tdSql.checkData(0, 7, "6")')
        tdSql.checkData(0, 7, "6")
1387
        # TSIM: return -1
1388
        # TSIM: endi
1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol3
        tdLog.info('alter table %s drop tag tgcol3' % (mt))
        tdSql.execute('alter table %s drop tag tgcol3' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol4
        tdLog.info('alter table %s drop tag tgcol4' % (mt))
        tdSql.execute('alter table %s drop tag tgcol4' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol5
        tdLog.info('alter table %s drop tag tgcol5' % (mt))
        tdSql.execute('alter table %s drop tag tgcol5' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $mt add tag tgcol2 binary(10)
        tdLog.info('alter table %s add tag tgcol2 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol2 binary(10)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol3 int
        tdLog.info('alter table %s add tag tgcol3 int' % (mt))
        tdSql.execute('alter table %s add tag tgcol3 int' % (mt))
        # TSIM: sql alter table $mt add tag tgcol4 binary(10)
        tdLog.info('alter table %s add tag tgcol4 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 binary(10)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol5 bigint
        tdLog.info('alter table %s add tag tgcol5 bigint' % (mt))
        tdSql.execute('alter table %s add tag tgcol5 bigint' % (mt))
        # TSIM:
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol1=false
        tdLog.info('alter table %s set tag tgcol1=false' % (tb))
        tdSql.execute('alter table %s set tag tgcol1=false' % (tb))
        # TSIM: sql alter table $tb set tag tgcol2=5
        tdLog.info('alter table %s set tag tgcol2=5' % (tb))
        tdSql.execute('alter table %s set tag tgcol2=5' % (tb))
        # TSIM: sql alter table $tb set tag tgcol3=4
        tdLog.info('alter table %s set tag tgcol3=4' % (tb))
        tdSql.execute('alter table %s set tag tgcol3=4' % (tb))
        # TSIM: sql alter table $tb set tag tgcol4=3
        tdLog.info('alter table %s set tag tgcol4=3' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=3' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=2
        tdLog.info('alter table %s set tag tgcol5=2' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=2' % (tb))
        # TSIM: sql alter table $tb set tag tgcol6=1
        tdLog.info('alter table %s set tag tgcol6=1' % (tb))
        tdSql.execute('alter table %s set tag tgcol6=1' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = '3'
        tdLog.info('select * from %s where tgcol4 = "3"' % (mt))
        tdSql.query('select * from %s where tgcol4 = "3"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1452
        # TSIM: endi
1453 1454 1455 1456
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1457
        # TSIM: endi
1458 1459 1460 1461
        # TSIM: if $data02 != 0 then
        tdLog.info('tdSql.checkData(0, 2, 0)')
        tdSql.checkData(0, 2, 0)
        # TSIM: return -1
1462
        # TSIM: endi
1463
        # TSIM: if $data03 != 1 then
S
Shuduo Sang 已提交
1464 1465
        tdLog.info('tdSql.checkData(0, 3, "1")')
        tdSql.checkData(0, 3, "1")
1466
        # TSIM: return -1
1467
        # TSIM: endi
1468
        # TSIM: if $data04 != 5 then
S
Shuduo Sang 已提交
1469 1470
        tdLog.info('tdSql.checkData(0, 4, "5")')
        tdSql.checkData(0, 4, "5")
1471
        # TSIM: return -1
1472
        # TSIM: endi
1473 1474 1475 1476
        # TSIM: if $data05 != 4 then
        tdLog.info('tdSql.checkData(0, 5, 4)')
        tdSql.checkData(0, 5, 4)
        # TSIM: return -1
1477
        # TSIM: endi
1478
        # TSIM: if $data06 != 3 then
S
Shuduo Sang 已提交
1479 1480
        tdLog.info('tdSql.checkData(0, 6, "3")')
        tdSql.checkData(0, 6, "3")
1481
        # TSIM: return -1
1482
        # TSIM: endi
1483 1484 1485 1486
        # TSIM: if $data07 != 2 then
        tdLog.info('tdSql.checkData(0, 7, 2)')
        tdSql.checkData(0, 7, 2)
        # TSIM: return -1
1487
        # TSIM: endi
1488 1489 1490 1491 1492 1493 1494 1495
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = '5'
        tdLog.info('select * from %s where tgcol2 = "5"' % (mt))
        tdSql.query('select * from %s where tgcol2 = "5"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1496
        # TSIM: endi
1497 1498 1499 1500 1501 1502 1503 1504
        # TSIM:
        # TSIM: sql select * from $mt where tgcol3 = 4
        tdLog.info('select * from %s where tgcol3 = 4' % (mt))
        tdSql.query('select * from %s where tgcol3 = 4' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1505
        # TSIM: endi
1506 1507 1508 1509 1510 1511 1512 1513
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = 2
        tdLog.info('select * from %s where tgcol5 = 2' % (mt))
        tdSql.query('select * from %s where tgcol5 = 2' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1514
        # TSIM: endi
1515 1516 1517 1518 1519 1520 1521 1522
        # TSIM:
        # TSIM: sql select * from $mt where tgcol6 = '1'
        tdLog.info('select * from %s where tgcol6 = "1"' % (mt))
        tdSql.query('select * from %s where tgcol6 = "1"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1523
        # TSIM: endi
1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558
        # TSIM:
        # TSIM: print =============== step13
        tdLog.info('=============== step13')
        # TSIM: $i = 13
        i = 13
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM: sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1
        # binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5
        # double, tgcol6 binary(20))
        tdLog.info(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20))' %
            (mt))
        tdSql.execute(
            'create table %s (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20))' %
            (mt))
        # TSIM: sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' )
        tdLog.info(
            'create table %s using %s tags( "1", 2, 3, "4", 5, "6" )' %
            (tb, mt))
        tdSql.execute(
            'create table %s using %s tags( "1", 2, 3, "4", 5, "6" )' %
            (tb, mt))
        # TSIM: sql insert into $tb values(now, 1)
        tdLog.info('insert into %s values(now, 1)' % (tb))
        tdSql.execute('insert into %s values(now, 1)' % (tb))
        # TSIM: sql select * from $mt where tgcol1 = '1'
        tdLog.info('select * from %s where tgcol1 = "1"' % (mt))
        tdSql.query('select * from %s where tgcol1 = "1"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1559
        # TSIM: endi
1560 1561 1562 1563
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1564
        # TSIM: endi
1565
        # TSIM: if $data02 != 1 then
S
Shuduo Sang 已提交
1566 1567
        tdLog.info('tdSql.checkData(0, 2, "1")')
        tdSql.checkData(0, 2, "1")
1568
        # TSIM: return -1
1569
        # TSIM: endi
1570 1571 1572 1573
        # TSIM: if $data03 != 2 then
        tdLog.info('tdSql.checkData(0, 3, 2)')
        tdSql.checkData(0, 3, 2)
        # TSIM: return -1
1574
        # TSIM: endi
1575 1576 1577 1578
        # TSIM: if $data04 != 3 then
        tdLog.info('tdSql.checkData(0, 4, 3)')
        tdSql.checkData(0, 4, 3)
        # TSIM: return -1
1579
        # TSIM: endi
1580
        # TSIM: if $data05 != 4 then
S
Shuduo Sang 已提交
1581 1582
        tdLog.info('tdSql.checkData(0, 5, "4")')
        tdSql.checkData(0, 5, "4")
1583
        # TSIM: return -1
1584
        # TSIM: endi
1585 1586 1587 1588
        # TSIM: if $data06 != 5.000000000 then
        tdLog.info('tdSql.checkData(0, 6, 5.000000000)')
        tdSql.checkData(0, 6, 5.000000000)
        # TSIM: return -1
1589
        # TSIM: endi
1590
        # TSIM: if $data07 != 6 then
S
Shuduo Sang 已提交
1591 1592
        tdLog.info('tdSql.checkData(0, 7, "6")')
        tdSql.checkData(0, 7, "6")
1593
        # TSIM: return -1
1594
        # TSIM: endi
1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651
        # TSIM:
        # TSIM: sql alter table $mt drop tag tgcol2
        tdLog.info('alter table %s drop tag tgcol2' % (mt))
        tdSql.execute('alter table %s drop tag tgcol2' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol4
        tdLog.info('alter table %s drop tag tgcol4' % (mt))
        tdSql.execute('alter table %s drop tag tgcol4' % (mt))
        # TSIM: sql alter table $mt drop tag tgcol6
        tdLog.info('alter table %s drop tag tgcol6' % (mt))
        tdSql.execute('alter table %s drop tag tgcol6' % (mt))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $mt add tag tgcol2 binary(10)
        tdLog.info('alter table %s add tag tgcol2 binary(10)' % (mt))
        tdSql.execute('alter table %s add tag tgcol2 binary(10)' % (mt))
        # TSIM: sql alter table $mt add tag tgcol4 int
        tdLog.info('alter table %s add tag tgcol4 int' % (mt))
        tdSql.execute('alter table %s add tag tgcol4 int' % (mt))
        # TSIM: sql alter table $mt add tag tgcol6 bigint
        tdLog.info('alter table %s add tag tgcol6 bigint' % (mt))
        tdSql.execute('alter table %s add tag tgcol6 bigint' % (mt))
        # TSIM:
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM: sql alter table $tb set tag tgcol1=7
        tdLog.info('alter table %s set tag tgcol1=7' % (tb))
        tdSql.execute('alter table %s set tag tgcol1=7' % (tb))
        # TSIM: sql alter table $tb set tag tgcol2=8
        tdLog.info('alter table %s set tag tgcol2=8' % (tb))
        tdSql.execute('alter table %s set tag tgcol2=8' % (tb))
        # TSIM: sql alter table $tb set tag tgcol3=9
        tdLog.info('alter table %s set tag tgcol3=9' % (tb))
        tdSql.execute('alter table %s set tag tgcol3=9' % (tb))
        # TSIM: sql alter table $tb set tag tgcol4=10
        tdLog.info('alter table %s set tag tgcol4=10' % (tb))
        tdSql.execute('alter table %s set tag tgcol4=10' % (tb))
        # TSIM: sql alter table $tb set tag tgcol5=11
        tdLog.info('alter table %s set tag tgcol5=11' % (tb))
        tdSql.execute('alter table %s set tag tgcol5=11' % (tb))
        # TSIM: sql alter table $tb set tag tgcol6=12
        tdLog.info('alter table %s set tag tgcol6=12' % (tb))
        tdSql.execute('alter table %s set tag tgcol6=12' % (tb))
        # TSIM: sql reset query cache
        tdLog.info('reset query cache')
        tdSql.execute('reset query cache')
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = '8'
        tdLog.info('select * from %s where tgcol2 = "8"' % (mt))
        tdSql.query('select * from %s where tgcol2 = "8"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1652
        # TSIM: endi
1653 1654 1655 1656
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1657
        # TSIM: endi
1658
        # TSIM: if $data02 != 7 then
S
Shuduo Sang 已提交
1659 1660
        tdLog.info('tdSql.checkData(0, 2, "7")')
        tdSql.checkData(0, 2, "7")
1661
        # TSIM: return -1
1662
        # TSIM: endi
1663 1664 1665 1666
        # TSIM: if $data03 != 9 then
        tdLog.info('tdSql.checkData(0, 3, 9)')
        tdSql.checkData(0, 3, 9)
        # TSIM: return -1
1667
        # TSIM: endi
1668 1669 1670 1671
        # TSIM: if $data04 != 11.000000000 then
        tdLog.info('tdSql.checkData(0, 4, 11.000000000)')
        tdSql.checkData(0, 4, 11.000000000)
        # TSIM: return -1
1672
        # TSIM: endi
1673
        # TSIM: if $data05 != 8 then
S
Shuduo Sang 已提交
1674 1675
        tdLog.info('tdSql.checkData(0, 5, "8")')
        tdSql.checkData(0, 5, "8")
1676
        # TSIM: return -1
1677
        # TSIM: endi
1678 1679 1680 1681
        # TSIM: if $data06 != 10 then
        tdLog.info('tdSql.checkData(0, 6, 10)')
        tdSql.checkData(0, 6, 10)
        # TSIM: return -1
1682
        # TSIM: endi
1683 1684 1685 1686
        # TSIM: if $data07 != 12 then
        tdLog.info('tdSql.checkData(0, 7, 12)')
        tdSql.checkData(0, 7, 12)
        # TSIM: return -1
1687
        # TSIM: endi
1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719
        # TSIM:
        # TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
        # TSIM: sleep 5000
        # TSIM: system sh/exec.sh -n dnode1 -s start
        # TSIM: sleep 3000
        # TSIM:
        # TSIM: print =============== step1
        tdLog.info('=============== step1')
        # TSIM: $i = 0
        i = 0
        # TSIM: $db = $dbPrefix . $i
        # TSIM:
        # TSIM: sql use $db
        # TSIM:
        # TSIM: print =============== step2
        tdLog.info('=============== step2')
        # TSIM: $i = 2
        i = 2
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1720
        # TSIM: endi
1721 1722 1723 1724
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1725
        # TSIM: endi
1726 1727 1728 1729
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
1730
        # TSIM: endi
1731 1732 1733 1734
        # TSIM: if $data03 != 4 then
        tdLog.info('tdSql.checkData(0, 3, 4)')
        tdSql.checkData(0, 3, 4)
        # TSIM: return -1
1735
        # TSIM: endi
1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754
        # TSIM:
        # TSIM: print =============== step3
        tdLog.info('=============== step3')
        # TSIM: $i = 3
        i = 3
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1755
        # TSIM: endi
1756 1757 1758 1759
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1760
        # TSIM: endi
1761 1762 1763 1764
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
1765
        # TSIM: endi
1766 1767 1768 1769
        # TSIM: if $data03 != 4 then
        tdLog.info('tdSql.checkData(0, 3, 4)')
        tdSql.checkData(0, 3, 4)
        # TSIM: return -1
1770
        # TSIM: endi
1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789
        # TSIM:
        # TSIM: print =============== step4
        tdLog.info('=============== step4')
        # TSIM: $i = 4
        i = 4
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1790
        # TSIM: endi
1791 1792 1793 1794
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1795
        # TSIM: endi
1796 1797 1798 1799
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
1800
        # TSIM: endi
1801 1802 1803 1804
        # TSIM: if $data03 != 4.00000 then
        tdLog.info('tdSql.checkData(0, 3, 4.00000)')
        tdSql.checkData(0, 3, 4.00000)
        # TSIM: return -1
1805
        # TSIM: endi
1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825
        # TSIM:
        # TSIM:
        # TSIM: print =============== step5
        tdLog.info('=============== step5')
        # TSIM: $i = 5
        i = 5
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 4
        tdLog.info('select * from %s where tgcol4 = 4' % (mt))
        tdSql.query('select * from %s where tgcol4 = 4' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1826
        # TSIM: endi
1827 1828 1829 1830
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1831
        # TSIM: endi
1832 1833 1834 1835
        # TSIM: if $data02 != 1.000000000 then
        tdLog.info('tdSql.checkData(0, 2, 1.000000000)')
        tdSql.checkData(0, 2, 1.000000000)
        # TSIM: return -1
1836
        # TSIM: endi
1837 1838 1839 1840
        # TSIM: if $data03 != 4 then
        tdLog.info('tdSql.checkData(0, 3, 4)')
        tdSql.checkData(0, 3, 4)
        # TSIM: return -1
1841
        # TSIM: endi
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861
        # TSIM:
        # TSIM:
        # TSIM: print =============== step6
        tdLog.info('=============== step6')
        # TSIM: $i = 6
        i = 6
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = '5'
        tdLog.info('select * from %s where tgcol5 = "5"' % (mt))
        tdSql.query('select * from %s where tgcol5 = "5"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1862
        # TSIM: endi
1863 1864 1865 1866
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1867
        # TSIM: endi
1868 1869 1870 1871
        # TSIM: if $data02 != 0 then
        tdLog.info('tdSql.checkData(0, 2, 0)')
        tdSql.checkData(0, 2, 0)
        # TSIM: return -1
1872
        # TSIM: endi
1873
        # TSIM: if $data03 != 5 then
S
Shuduo Sang 已提交
1874 1875
        tdLog.info('tdSql.checkData(0, 3, "5")')
        tdSql.checkData(0, 3, "5")
1876
        # TSIM: return -1
1877
        # TSIM: endi
1878
        # TSIM: if $data04 != 6 then
S
Shuduo Sang 已提交
1879 1880
        tdLog.info('tdSql.checkData(0, 4, "6")')
        tdSql.checkData(0, 4, "6")
1881
        # TSIM: return -1
1882
        # TSIM: endi
1883 1884 1885 1886 1887 1888 1889 1890 1891 1892
        # TSIM:
        # TSIM: sql select * from $mt where tgcol6 = '6'
        tdLog.info('select * from %s where tgcol6 = "6"' % (mt))
        tdSql.query('select * from %s where tgcol6 = "6"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1893
        # TSIM: endi
1894 1895 1896 1897
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1898
        # TSIM: endi
1899 1900 1901 1902
        # TSIM: if $data02 != 0 then
        tdLog.info('tdSql.checkData(0, 2, 0)')
        tdSql.checkData(0, 2, 0)
        # TSIM: return -1
1903
        # TSIM: endi
1904
        # TSIM: if $data03 != 5 then
S
Shuduo Sang 已提交
1905 1906
        tdLog.info(': tdSql.checkData(0, 3, "5")')
        tdSql.checkData(0, 3, "5")
1907
        # TSIM: return -1
1908
        # TSIM: endi
1909
        # TSIM: if $data04 != 6 then
S
Shuduo Sang 已提交
1910 1911
        tdLog.info('tdSql.checkData(0, 4, "6")')
        tdSql.checkData(0, 4, "6")
1912
        # TSIM: return -1
1913
        # TSIM: endi
1914 1915 1916 1917 1918 1919 1920 1921
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = 1
        tdLog.info('select * from %s where tgcol4 = 1' % (mt))
        tdSql.query('select * from %s where tgcol4 = 1' % (mt))
        # TSIM: if $rows != 0 then
        tdLog.info('tdSql.checkRow(0)')
        tdSql.checkRows(0)
        # TSIM: return -1
1922
        # TSIM: endi
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941
        # TSIM:
        # TSIM: print =============== step7
        tdLog.info('=============== step7')
        # TSIM: $i = 7
        i = 7
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol6 = 6
        tdLog.info('select * from %s where tgcol6 = 6' % (mt))
        tdSql.query('select * from %s where tgcol6 = 6' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1942
        # TSIM: endi
1943 1944 1945 1946
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1947
        # TSIM: endi
1948 1949 1950 1951
        # TSIM: if $data02 != 4 then
        tdLog.info('tdSql.checkData(0, 2, 4)')
        tdSql.checkData(0, 2, 4)
        # TSIM: return -1
1952
        # TSIM: endi
1953 1954 1955 1956
        # TSIM: if $data03 != 5 then
        tdLog.info('tdSql.checkData(0, 3, 5)')
        tdSql.checkData(0, 3, 5)
        # TSIM: return -1
1957
        # TSIM: endi
1958 1959 1960 1961
        # TSIM: if $data04 != 6 then
        tdLog.info('tdSql.checkData(0, 4, 6)')
        tdSql.checkData(0, 4, 6)
        # TSIM: return -1
1962
        # TSIM: endi
1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982
        # TSIM:
        # TSIM:
        # TSIM: print =============== step8
        tdLog.info('=============== step8')
        # TSIM: $i = 8
        i = 8
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = '5'
        tdLog.info('select * from %s where tgcol5 = "5"' % (mt))
        tdSql.query('select * from %s where tgcol5 = "5"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
1983
        # TSIM: endi
1984 1985 1986 1987
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
1988
        # TSIM: endi
1989 1990 1991 1992
        # TSIM: if $data02 != 4 then
        tdLog.info('tdSql.checkData(0, 2, 4)')
        tdSql.checkData(0, 2, 4)
        # TSIM: return -1
1993
        # TSIM: endi
1994
        # TSIM: if $data03 != 5 then
S
Shuduo Sang 已提交
1995 1996
        tdLog.info('tdSql.checkData(0, 3, "5")')
        tdSql.checkData(0, 3, "5")
1997
        # TSIM: return -1
1998
        # TSIM: endi
1999 2000 2001 2002
        # TSIM: if $data04 != 1 then
        tdLog.info('tdSql.checkData(0, 4, 1)')
        tdSql.checkData(0, 4, 1)
        # TSIM: return -1
2003
        # TSIM: endi
2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023
        # TSIM:
        # TSIM:
        # TSIM: print =============== step9
        tdLog.info('=============== step9')
        # TSIM: $i = 9
        i = 9
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = 1
        tdLog.info('select * from %s where tgcol5 = 1' % (mt))
        tdSql.query('select * from %s where tgcol5 = 1' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2024
        # TSIM: endi
2025 2026 2027 2028
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
2029
        # TSIM: endi
2030 2031 2032 2033
        # TSIM: if $data02 != 4.000000000 then
        tdLog.info('tdSql.checkData(0, 2, 4.000000000)')
        tdSql.checkData(0, 2, 4.000000000)
        # TSIM: return -1
2034
        # TSIM: endi
2035 2036 2037 2038
        # TSIM: if $data03 != 1 then
        tdLog.info('tdSql.checkData(0, 3, 1)')
        tdSql.checkData(0, 3, 1)
        # TSIM: return -1
2039
        # TSIM: endi
2040 2041 2042 2043
        # TSIM: if $data04 != 6.00000 then
        tdLog.info('tdSql.checkData(0, 4, 6.00000)')
        tdSql.checkData(0, 4, 6.00000)
        # TSIM: return -1
2044
        # TSIM: endi
2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064
        # TSIM:
        # TSIM:
        # TSIM: print =============== step10
        tdLog.info('=============== step10')
        # TSIM: $i = 10
        i = 10
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = '4'
        tdLog.info('select * from %s where tgcol4 = "4"' % (mt))
        tdSql.query('select * from %s where tgcol4 = "4"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2065
        # TSIM: endi
2066 2067 2068 2069
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
2070
        # TSIM: endi
2071
        # TSIM: if $data02 != 1 then
S
Shuduo Sang 已提交
2072 2073
        tdLog.info('tdSql.checkData(0, 2, "1")')
        tdSql.checkData(0, 2, "1")
2074
        # TSIM: return -1
2075
        # TSIM: endi
2076
        # TSIM: if $data03 != 4 then
S
Shuduo Sang 已提交
2077 2078
        tdLog.info('tdSql.checkData(0, 3, "4")')
        tdSql.checkData(0, 3, "4")
2079
        # TSIM: return -1
2080
        # TSIM: endi
2081 2082 2083 2084
        # TSIM: if $data04 != 0 then
        tdLog.info('tdSql.checkData(0, 4, 0)')
        tdSql.checkData(0, 4, 0)
        # TSIM: return -1
2085
        # TSIM: endi
2086 2087
        # TSIM: if $data05 != NULL then
        tdLog.info('tdSql.checkData(0, 5, NULL)')
S
Shuduo Sang 已提交
2088 2089 2090 2091 2092
        try:
            tdSql.checkData(0, 5, None)
        except Exception as e:
            tdLog.info(repr(e))
            tdLog.info("out of range")
2093
        # TSIM: return -1
2094
        # TSIM: endi
2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113
        # TSIM:
        # TSIM: print =============== step11
        tdLog.info('=============== step11')
        # TSIM: $i = 11
        i = 11
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 =5
        tdLog.info('select * from %s where tgcol5 =5' % (mt))
        tdSql.query('select * from %s where tgcol5 =5' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2114
        # TSIM: endi
2115 2116 2117 2118
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
2119
        # TSIM: endi
2120 2121 2122 2123
        # TSIM: if $data02 != 1 then
        tdLog.info('tdSql.checkData(0, 2, 1)')
        tdSql.checkData(0, 2, 1)
        # TSIM: return -1
2124
        # TSIM: endi
2125
        # TSIM: if $data03 != 4 then
S
Shuduo Sang 已提交
2126 2127
        tdLog.info('tdSql.checkData(0, 3, "4")')
        tdSql.checkData(0, 3, "4")
2128
        # TSIM: return -1
2129
        # TSIM: endi
2130 2131 2132 2133
        # TSIM: if $data04 != 5 then
        tdLog.info('tdSql.checkData(0, 4, 5)')
        tdSql.checkData(0, 4, 5)
        # TSIM: return -1
2134
        # TSIM: endi
2135
        # TSIM: if $data05 != 6 then
S
Shuduo Sang 已提交
2136 2137
        tdLog.info('tdSql.checkData(0, 5, "6")')
        tdSql.checkData(0, 5, "6")
2138
        # TSIM: return -1
2139
        # TSIM: endi
2140 2141 2142 2143
        # TSIM: if $data06 != 7 then
        tdLog.info('tdSql.checkData(0, 6, 7)')
        tdSql.checkData(0, 6, 7)
        # TSIM: return -1
2144
        # TSIM: endi
2145 2146 2147 2148
        # TSIM: if $data07 != 8 then
        tdLog.info('tdSql.checkData(0, 7, 8)')
        tdSql.checkData(0, 7, 8)
        # TSIM: return -1
2149
        # TSIM: endi
2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169
        # TSIM:
        # TSIM: print =============== step12
        tdLog.info('=============== step12')
        # TSIM: $i = 12
        i = 12
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM:
        # TSIM: sql select * from $mt where tgcol4 = '3'
        tdLog.info('select * from %s where tgcol4 = "3"' % (mt))
        tdSql.query('select * from %s where tgcol4 = "3"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2170
        # TSIM: endi
2171 2172 2173 2174
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
2175
        # TSIM: endi
2176 2177 2178 2179
        # TSIM: if $data02 != 0 then
        tdLog.info('tdSql.checkData(0, 2, 0)')
        tdSql.checkData(0, 2, 0)
        # TSIM: return -1
2180
        # TSIM: endi
2181
        # TSIM: if $data03 != 1 then
S
Shuduo Sang 已提交
2182 2183
        tdLog.info('tdSql.checkData(0, 3, "1")')
        tdSql.checkData(0, 3, "1")
2184
        # TSIM: return -1
2185
        # TSIM: endi
2186
        # TSIM: if $data04 != 5 then
S
Shuduo Sang 已提交
2187 2188
        tdLog.info('tdSql.checkData(0, 4, "5")')
        tdSql.checkData(0, 4, "5")
2189
        # TSIM: return -1
2190
        # TSIM: endi
2191 2192 2193 2194
        # TSIM: if $data05 != 4 then
        tdLog.info('tdSql.checkData(0, 5, 4)')
        tdSql.checkData(0, 5, 4)
        # TSIM: return -1
2195
        # TSIM: endi
2196
        # TSIM: if $data06 != 3 then
S
Shuduo Sang 已提交
2197 2198
        tdLog.info('tdSql.checkData(0, 6, "3")')
        tdSql.checkData(0, 6, "3")
2199
        # TSIM: return -1
2200
        # TSIM: endi
2201 2202 2203 2204
        # TSIM: if $data07 != 2 then
        tdLog.info('tdSql.checkData(0, 7, 2)')
        tdSql.checkData(0, 7, 2)
        # TSIM: return -1
2205
        # TSIM: endi
2206 2207 2208 2209 2210 2211 2212 2213
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = '5'
        tdLog.info('select * from %s where tgcol2 = "5"' % (mt))
        tdSql.query('select * from %s where tgcol2 = "5"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2214
        # TSIM: endi
2215 2216 2217 2218 2219 2220 2221 2222
        # TSIM:
        # TSIM: sql select * from $mt where tgcol3 = 4
        tdLog.info('select * from %s where tgcol3 = 4' % (mt))
        tdSql.query('select * from %s where tgcol3 = 4' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2223
        # TSIM: endi
2224 2225 2226 2227 2228 2229 2230 2231
        # TSIM:
        # TSIM: sql select * from $mt where tgcol5 = 2
        tdLog.info('select * from %s where tgcol5 = 2' % (mt))
        tdSql.query('select * from %s where tgcol5 = 2' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2232
        # TSIM: endi
2233 2234 2235 2236 2237 2238 2239 2240
        # TSIM:
        # TSIM: sql select * from $mt where tgcol6 = '1'
        tdLog.info('select * from %s where tgcol6 = "1"' % (mt))
        tdSql.query('select * from %s where tgcol6 = "1"' % (mt))
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2241
        # TSIM: endi
2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260
        # TSIM:
        # TSIM: print =============== step13
        tdLog.info('=============== step13')
        # TSIM: $i = 13
        i = 13
        # TSIM: $mt = $mtPrefix . $i
        mt = "%s%d" % (mtPrefix, i)
        # TSIM: $tb = $tbPrefix . $i
        tb = "%s%d" % (tbPrefix, i)
        # TSIM:
        # TSIM: sql select * from $mt where tgcol2 = '8'
        tdLog.info('select * from %s where tgcol2 = "8"' % (mt))
        tdSql.query('select * from %s where tgcol2 = "8"' % (mt))
        # TSIM: print $data01 $data02 $data03
        tdLog.info('$data01 $data02 $data03')
        # TSIM: if $rows != 1 then
        tdLog.info('tdSql.checkRow(1)')
        tdSql.checkRows(1)
        # TSIM: return -1
2261
        # TSIM: endi
2262 2263 2264 2265
        # TSIM: if $data01 != 1 then
        tdLog.info('tdSql.checkData(0, 1, 1)')
        tdSql.checkData(0, 1, 1)
        # TSIM: return -1
2266
        # TSIM: endi
2267
        # TSIM: if $data02 != 7 then
S
Shuduo Sang 已提交
2268 2269
        tdLog.info('tdSql.checkData(0, 2, "7")')
        tdSql.checkData(0, 2, "7")
2270
        # TSIM: return -1
2271
        # TSIM: endi
2272 2273 2274 2275
        # TSIM: if $data03 != 9 then
        tdLog.info('tdSql.checkData(0, 3, 9)')
        tdSql.checkData(0, 3, 9)
        # TSIM: return -1
2276
        # TSIM: endi
2277 2278 2279 2280
        # TSIM: if $data04 != 11.000000000 then
        tdLog.info('tdSql.checkData(0, 4, 11.000000000)')
        tdSql.checkData(0, 4, 11.000000000)
        # TSIM: return -1
2281
        # TSIM: endi
2282
        # TSIM: if $data05 != 8 then
S
Shuduo Sang 已提交
2283 2284
        tdLog.info('tdSql.checkData(0, 5, "8")')
        tdSql.checkData(0, 5, "8")
2285
        # TSIM: return -1
2286
        # TSIM: endi
2287 2288 2289 2290
        # TSIM: if $data06 != 10 then
        tdLog.info('tdSql.checkData(0, 6, 10)')
        tdSql.checkData(0, 6, 10)
        # TSIM: return -1
2291
        # TSIM: endi
2292 2293 2294 2295
        # TSIM: if $data07 != 12 then
        tdLog.info('tdSql.checkData(0, 7, 12)')
        tdSql.checkData(0, 7, 12)
        # TSIM: return -1
2296
        # TSIM: endi
2297 2298 2299 2300
        # TSIM:
        # TSIM: print =============== clear
        tdLog.info('=============== clear')
        # TSIM: sql drop database $db
S
Shuduo Sang 已提交
2301 2302
        tdLog.info('drop database db')
        tdSql.execute('drop database db')
2303 2304 2305 2306 2307 2308 2309
        # TSIM: sql show databases
        tdLog.info('show databases')
        tdSql.query('show databases')
        # TSIM: if $rows != 0 then
        tdLog.info('tdSql.checkRow(0)')
        tdSql.checkRows(0)
        # TSIM: return -1
2310
        # TSIM: endi
2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321
        # TSIM:
        # TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end

    def stop(self):
        tdSql.close()
        tdLog.success("%s successfully executed" % __file__)


tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())