os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/tkt2927.test
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
# 2008 Feb 6
sl@0
     2
#
sl@0
     3
# The author disclaims copyright to this source code. In place of
sl@0
     4
# a legal notice, here is a blessing:
sl@0
     5
#
sl@0
     6
#    May you do good and not evil.
sl@0
     7
#    May you find forgiveness for yourself and forgive others.
sl@0
     8
#    May you share freely, never taking more than you give.
sl@0
     9
#
sl@0
    10
#***********************************************************************
sl@0
    11
#
sl@0
    12
# This file is to test that ticket #2927 is fixed.
sl@0
    13
#
sl@0
    14
# $Id: tkt2927.test,v 1.4 2008/08/04 03:51:24 danielk1977 Exp $
sl@0
    15
#
sl@0
    16
sl@0
    17
set testdir [file dirname $argv0]
sl@0
    18
source $testdir/tester.tcl
sl@0
    19
sl@0
    20
ifcapable !compound {
sl@0
    21
  finish_test
sl@0
    22
  return
sl@0
    23
}
sl@0
    24
sl@0
    25
# Create a database.
sl@0
    26
#
sl@0
    27
do_test tkt2927-1.1 {
sl@0
    28
  db eval {
sl@0
    29
    CREATE TABLE t1(a, b);
sl@0
    30
    INSERT INTO t1 VALUES(1,11);
sl@0
    31
    INSERT INTO t1 VALUES(2,22);
sl@0
    32
    INSERT INTO t1 VALUES(3,33);
sl@0
    33
    INSERT INTO t1 VALUES(4,44);
sl@0
    34
    INSERT INTO t1 VALUES(5,55);
sl@0
    35
    SELECT * FROM t1;
sl@0
    36
  }
sl@0
    37
} {1 11 2 22 3 33 4 44 5 55}
sl@0
    38
sl@0
    39
sl@0
    40
do_test tkt2927-2.1 {
sl@0
    41
  db eval {
sl@0
    42
    SELECT a, b FROM t1
sl@0
    43
    UNION ALL
sl@0
    44
    SELECT a, b FROM t1
sl@0
    45
  }
sl@0
    46
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    47
do_test tkt2927-2.2 {
sl@0
    48
#set sqlite_addop_trace 1
sl@0
    49
  db eval {
sl@0
    50
    SELECT a, b FROM t1
sl@0
    51
    UNION ALL
sl@0
    52
    SELECT a, abs(b) FROM t1
sl@0
    53
  }
sl@0
    54
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    55
do_test tkt2927-2.3 {
sl@0
    56
  db eval {
sl@0
    57
    SELECT a, b FROM t1
sl@0
    58
    UNION ALL
sl@0
    59
    SELECT abs(a), b FROM t1
sl@0
    60
  }
sl@0
    61
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    62
do_test tkt2927-2.4 {
sl@0
    63
  db eval {
sl@0
    64
    SELECT a, b FROM t1
sl@0
    65
    UNION ALL
sl@0
    66
    SELECT abs(a), abs(b) FROM t1
sl@0
    67
  }
sl@0
    68
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    69
do_test tkt2927-2.5 {
sl@0
    70
  db eval {
sl@0
    71
    SELECT a, abs(b) FROM t1
sl@0
    72
    UNION ALL
sl@0
    73
    SELECT a, b FROM t1
sl@0
    74
  }
sl@0
    75
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    76
do_test tkt2927-2.6 {
sl@0
    77
  db eval {
sl@0
    78
    SELECT a, abs(b) FROM t1
sl@0
    79
    UNION ALL
sl@0
    80
    SELECT a, abs(b) FROM t1
sl@0
    81
  }
sl@0
    82
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    83
do_test tkt2927-2.7 {
sl@0
    84
  db eval {
sl@0
    85
    SELECT a, abs(b) FROM t1
sl@0
    86
    UNION ALL
sl@0
    87
    SELECT abs(a), b FROM t1
sl@0
    88
  }
sl@0
    89
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    90
do_test tkt2927-2.8 {
sl@0
    91
  db eval {
sl@0
    92
    SELECT a, abs(b) FROM t1
sl@0
    93
    UNION ALL
sl@0
    94
    SELECT abs(a), abs(b) FROM t1
sl@0
    95
  }
sl@0
    96
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
    97
do_test tkt2927-2.9 {
sl@0
    98
  db eval {
sl@0
    99
    SELECT abs(a), b FROM t1
sl@0
   100
    UNION ALL
sl@0
   101
    SELECT a, b FROM t1
sl@0
   102
  }
sl@0
   103
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   104
do_test tkt2927-2.10 {
sl@0
   105
  db eval {
sl@0
   106
    SELECT abs(a), b FROM t1
sl@0
   107
    UNION ALL
sl@0
   108
    SELECT a, abs(b) FROM t1
sl@0
   109
  }
sl@0
   110
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   111
do_test tkt2927-2.11 {
sl@0
   112
  db eval {
sl@0
   113
    SELECT abs(a), b FROM t1
sl@0
   114
    UNION ALL
sl@0
   115
    SELECT abs(a), b FROM t1
sl@0
   116
  }
sl@0
   117
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   118
do_test tkt2927-2.12 {
sl@0
   119
  db eval {
sl@0
   120
    SELECT abs(a), b FROM t1
sl@0
   121
    UNION ALL
sl@0
   122
    SELECT abs(a), abs(b) FROM t1
sl@0
   123
  }
sl@0
   124
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   125
do_test tkt2927-2.13 {
sl@0
   126
  db eval {
sl@0
   127
    SELECT abs(a), abs(b) FROM t1
sl@0
   128
    UNION ALL
sl@0
   129
    SELECT a, b FROM t1
sl@0
   130
  }
sl@0
   131
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   132
do_test tkt2927-2.14 {
sl@0
   133
  db eval {
sl@0
   134
    SELECT abs(a), abs(b) FROM t1
sl@0
   135
    UNION ALL
sl@0
   136
    SELECT a, abs(b) FROM t1
sl@0
   137
  }
sl@0
   138
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   139
do_test tkt2927-2.15 {
sl@0
   140
  db eval {
sl@0
   141
    SELECT abs(a), abs(b) FROM t1
sl@0
   142
    UNION ALL
sl@0
   143
    SELECT abs(a), b FROM t1
sl@0
   144
  }
sl@0
   145
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   146
do_test tkt2927-2.16 {
sl@0
   147
  db eval {
sl@0
   148
    SELECT abs(a), abs(b) FROM t1
sl@0
   149
    UNION ALL
sl@0
   150
    SELECT abs(a), abs(b) FROM t1
sl@0
   151
  }
sl@0
   152
} {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
sl@0
   153
sl@0
   154
sl@0
   155
do_test tkt2927-3.1 {
sl@0
   156
  db eval {
sl@0
   157
    SELECT a, b FROM t1
sl@0
   158
    UNION 
sl@0
   159
    SELECT a, b FROM t1
sl@0
   160
    ORDER BY 1
sl@0
   161
  }
sl@0
   162
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   163
do_test tkt2927-3.2 {
sl@0
   164
  db eval {
sl@0
   165
    SELECT a, b FROM t1
sl@0
   166
    UNION 
sl@0
   167
    SELECT a, abs(b) FROM t1
sl@0
   168
    ORDER BY 1
sl@0
   169
  }
sl@0
   170
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   171
do_test tkt2927-3.3 {
sl@0
   172
  db eval {
sl@0
   173
    SELECT a, b FROM t1
sl@0
   174
    UNION 
sl@0
   175
    SELECT abs(a), b FROM t1
sl@0
   176
    ORDER BY 1
sl@0
   177
  }
sl@0
   178
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   179
do_test tkt2927-3.4 {
sl@0
   180
  db eval {
sl@0
   181
    SELECT a, b FROM t1
sl@0
   182
    UNION 
sl@0
   183
    SELECT abs(a), abs(b) FROM t1
sl@0
   184
    ORDER BY 1
sl@0
   185
  }
sl@0
   186
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   187
do_test tkt2927-3.5 {
sl@0
   188
  db eval {
sl@0
   189
    SELECT a, abs(b) FROM t1
sl@0
   190
    UNION 
sl@0
   191
    SELECT a, b FROM t1
sl@0
   192
    ORDER BY 1
sl@0
   193
  }
sl@0
   194
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   195
do_test tkt2927-3.6 {
sl@0
   196
  db eval {
sl@0
   197
    SELECT a, abs(b) FROM t1
sl@0
   198
    UNION 
sl@0
   199
    SELECT a, abs(b) FROM t1
sl@0
   200
    ORDER BY 1
sl@0
   201
  }
sl@0
   202
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   203
do_test tkt2927-3.7 {
sl@0
   204
  db eval {
sl@0
   205
    SELECT a, abs(b) FROM t1
sl@0
   206
    UNION 
sl@0
   207
    SELECT abs(a), b FROM t1
sl@0
   208
    ORDER BY 1
sl@0
   209
  }
sl@0
   210
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   211
do_test tkt2927-3.8 {
sl@0
   212
  db eval {
sl@0
   213
    SELECT a, abs(b) FROM t1
sl@0
   214
    UNION 
sl@0
   215
    SELECT abs(a), abs(b) FROM t1
sl@0
   216
    ORDER BY 1
sl@0
   217
  }
sl@0
   218
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   219
do_test tkt2927-3.9 {
sl@0
   220
  db eval {
sl@0
   221
    SELECT abs(a), b FROM t1
sl@0
   222
    UNION 
sl@0
   223
    SELECT a, b FROM t1
sl@0
   224
    ORDER BY 1
sl@0
   225
  }
sl@0
   226
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   227
do_test tkt2927-3.10 {
sl@0
   228
  db eval {
sl@0
   229
    SELECT abs(a), b FROM t1
sl@0
   230
    UNION 
sl@0
   231
    SELECT a, abs(b) FROM t1
sl@0
   232
    ORDER BY 1
sl@0
   233
  }
sl@0
   234
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   235
do_test tkt2927-3.11 {
sl@0
   236
  db eval {
sl@0
   237
    SELECT abs(a), b FROM t1
sl@0
   238
    UNION 
sl@0
   239
    SELECT abs(a), b FROM t1
sl@0
   240
    ORDER BY 1
sl@0
   241
  }
sl@0
   242
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   243
do_test tkt2927-3.12 {
sl@0
   244
  db eval {
sl@0
   245
    SELECT abs(a), b FROM t1
sl@0
   246
    UNION 
sl@0
   247
    SELECT abs(a), abs(b) FROM t1
sl@0
   248
    ORDER BY 1
sl@0
   249
  }
sl@0
   250
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   251
do_test tkt2927-3.13 {
sl@0
   252
  db eval {
sl@0
   253
    SELECT abs(a), abs(b) FROM t1
sl@0
   254
    UNION 
sl@0
   255
    SELECT a, b FROM t1
sl@0
   256
    ORDER BY 1
sl@0
   257
  }
sl@0
   258
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   259
do_test tkt2927-3.14 {
sl@0
   260
  db eval {
sl@0
   261
    SELECT abs(a), abs(b) FROM t1
sl@0
   262
    UNION 
sl@0
   263
    SELECT a, abs(b) FROM t1
sl@0
   264
    ORDER BY 1
sl@0
   265
  }
sl@0
   266
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   267
do_test tkt2927-3.15 {
sl@0
   268
  db eval {
sl@0
   269
    SELECT abs(a), abs(b) FROM t1
sl@0
   270
    UNION 
sl@0
   271
    SELECT abs(a), b FROM t1
sl@0
   272
    ORDER BY 1
sl@0
   273
  }
sl@0
   274
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   275
do_test tkt2927-3.16 {
sl@0
   276
  db eval {
sl@0
   277
    SELECT abs(a), abs(b) FROM t1
sl@0
   278
    UNION 
sl@0
   279
    SELECT abs(a), abs(b) FROM t1
sl@0
   280
    ORDER BY 1
sl@0
   281
  }
sl@0
   282
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   283
sl@0
   284
sl@0
   285
do_test tkt2927-4.1 {
sl@0
   286
  db eval {
sl@0
   287
    SELECT a+b, a-b, a, b FROM t1
sl@0
   288
    UNION ALL
sl@0
   289
    SELECT a+b, a-b, a, b FROM t1
sl@0
   290
  }
sl@0
   291
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   292
do_test tkt2927-4.2 {
sl@0
   293
  db eval {
sl@0
   294
    SELECT a+b, a-b, a, b FROM t1
sl@0
   295
    UNION ALL
sl@0
   296
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   297
  }
sl@0
   298
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   299
do_test tkt2927-4.3 {
sl@0
   300
  db eval {
sl@0
   301
    SELECT a+b, a-b, a, b FROM t1
sl@0
   302
    UNION ALL
sl@0
   303
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   304
  }
sl@0
   305
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   306
do_test tkt2927-4.4 {
sl@0
   307
  db eval {
sl@0
   308
    SELECT a+b, a-b, a, b FROM t1
sl@0
   309
    UNION ALL
sl@0
   310
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   311
  }
sl@0
   312
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   313
do_test tkt2927-4.5 {
sl@0
   314
  db eval {
sl@0
   315
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   316
    UNION ALL
sl@0
   317
    SELECT a+b, a-b, a, b FROM t1
sl@0
   318
  }
sl@0
   319
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   320
do_test tkt2927-4.6 {
sl@0
   321
  db eval {
sl@0
   322
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   323
    UNION ALL
sl@0
   324
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   325
  }
sl@0
   326
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   327
do_test tkt2927-4.7 {
sl@0
   328
  db eval {
sl@0
   329
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   330
    UNION ALL
sl@0
   331
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   332
  }
sl@0
   333
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   334
do_test tkt2927-4.8 {
sl@0
   335
  db eval {
sl@0
   336
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   337
    UNION ALL
sl@0
   338
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   339
  }
sl@0
   340
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   341
do_test tkt2927-4.9 {
sl@0
   342
  db eval {
sl@0
   343
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   344
    UNION ALL
sl@0
   345
    SELECT a+b, a-b, a, b FROM t1
sl@0
   346
  }
sl@0
   347
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   348
do_test tkt2927-4.10 {
sl@0
   349
  db eval {
sl@0
   350
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   351
    UNION ALL
sl@0
   352
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   353
  }
sl@0
   354
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   355
do_test tkt2927-4.11 {
sl@0
   356
  db eval {
sl@0
   357
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   358
    UNION ALL
sl@0
   359
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   360
  }
sl@0
   361
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   362
do_test tkt2927-4.12 {
sl@0
   363
  db eval {
sl@0
   364
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   365
    UNION ALL
sl@0
   366
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   367
  }
sl@0
   368
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   369
do_test tkt2927-4.13 {
sl@0
   370
  db eval {
sl@0
   371
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   372
    UNION ALL
sl@0
   373
    SELECT a+b, a-b, a, b FROM t1
sl@0
   374
  }
sl@0
   375
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   376
do_test tkt2927-4.14 {
sl@0
   377
  db eval {
sl@0
   378
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   379
    UNION ALL
sl@0
   380
    SELECT a+b, a-b, a, abs(b) FROM t1
sl@0
   381
  }
sl@0
   382
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   383
do_test tkt2927-4.15 {
sl@0
   384
  db eval {
sl@0
   385
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   386
    UNION ALL
sl@0
   387
    SELECT a+b, a-b, abs(a), b FROM t1
sl@0
   388
  }
sl@0
   389
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   390
do_test tkt2927-4.16 {
sl@0
   391
  db eval {
sl@0
   392
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   393
    UNION ALL
sl@0
   394
    SELECT a+b, a-b, abs(a), abs(b) FROM t1
sl@0
   395
  }
sl@0
   396
} {12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55 12 -10 1 11 24 -20 2 22 36 -30 3 33 48 -40 4 44 60 -50 5 55}
sl@0
   397
sl@0
   398
sl@0
   399
do_test tkt2927-5.1 {
sl@0
   400
  db eval {
sl@0
   401
    SELECT a, b FROM t1
sl@0
   402
    EXCEPT
sl@0
   403
    SELECT a, b FROM t1
sl@0
   404
  }
sl@0
   405
} {}
sl@0
   406
do_test tkt2927-5.2 {
sl@0
   407
  db eval {
sl@0
   408
    SELECT a, b FROM t1
sl@0
   409
    EXCEPT
sl@0
   410
    SELECT a, abs(b) FROM t1
sl@0
   411
  }
sl@0
   412
} {}
sl@0
   413
do_test tkt2927-5.3 {
sl@0
   414
  db eval {
sl@0
   415
    SELECT a, b FROM t1
sl@0
   416
    EXCEPT
sl@0
   417
    SELECT abs(a), b FROM t1
sl@0
   418
  }
sl@0
   419
} {}
sl@0
   420
do_test tkt2927-5.4 {
sl@0
   421
  db eval {
sl@0
   422
    SELECT a, b FROM t1
sl@0
   423
    EXCEPT
sl@0
   424
    SELECT abs(a), abs(b) FROM t1
sl@0
   425
  }
sl@0
   426
} {}
sl@0
   427
do_test tkt2927-5.5 {
sl@0
   428
  db eval {
sl@0
   429
    SELECT a, abs(b) FROM t1
sl@0
   430
    EXCEPT
sl@0
   431
    SELECT a, b FROM t1
sl@0
   432
  }
sl@0
   433
} {}
sl@0
   434
do_test tkt2927-5.6 {
sl@0
   435
  db eval {
sl@0
   436
    SELECT a, abs(b) FROM t1
sl@0
   437
    EXCEPT
sl@0
   438
    SELECT a, abs(b) FROM t1
sl@0
   439
  }
sl@0
   440
} {}
sl@0
   441
do_test tkt2927-5.7 {
sl@0
   442
  db eval {
sl@0
   443
    SELECT a, abs(b) FROM t1
sl@0
   444
    EXCEPT
sl@0
   445
    SELECT abs(a), b FROM t1
sl@0
   446
  }
sl@0
   447
} {}
sl@0
   448
do_test tkt2927-5.8 {
sl@0
   449
  db eval {
sl@0
   450
    SELECT a, abs(b) FROM t1
sl@0
   451
    EXCEPT
sl@0
   452
    SELECT abs(a), abs(b) FROM t1
sl@0
   453
  }
sl@0
   454
} {}
sl@0
   455
do_test tkt2927-5.9 {
sl@0
   456
  db eval {
sl@0
   457
    SELECT abs(a), b FROM t1
sl@0
   458
    EXCEPT
sl@0
   459
    SELECT a, b FROM t1
sl@0
   460
  }
sl@0
   461
} {}
sl@0
   462
do_test tkt2927-5.10 {
sl@0
   463
  db eval {
sl@0
   464
    SELECT abs(a), b FROM t1
sl@0
   465
    EXCEPT
sl@0
   466
    SELECT a, abs(b) FROM t1
sl@0
   467
  }
sl@0
   468
} {}
sl@0
   469
do_test tkt2927-5.11 {
sl@0
   470
  db eval {
sl@0
   471
    SELECT abs(a), b FROM t1
sl@0
   472
    EXCEPT
sl@0
   473
    SELECT abs(a), b FROM t1
sl@0
   474
  }
sl@0
   475
} {}
sl@0
   476
do_test tkt2927-5.12 {
sl@0
   477
  db eval {
sl@0
   478
    SELECT abs(a), b FROM t1
sl@0
   479
    EXCEPT
sl@0
   480
    SELECT abs(a), abs(b) FROM t1
sl@0
   481
  }
sl@0
   482
} {}
sl@0
   483
do_test tkt2927-5.13 {
sl@0
   484
  db eval {
sl@0
   485
    SELECT abs(a), abs(b) FROM t1
sl@0
   486
    EXCEPT
sl@0
   487
    SELECT a, b FROM t1
sl@0
   488
  }
sl@0
   489
} {}
sl@0
   490
do_test tkt2927-5.14 {
sl@0
   491
  db eval {
sl@0
   492
    SELECT abs(a), abs(b) FROM t1
sl@0
   493
    EXCEPT
sl@0
   494
    SELECT a, abs(b) FROM t1
sl@0
   495
  }
sl@0
   496
} {}
sl@0
   497
do_test tkt2927-5.15 {
sl@0
   498
  db eval {
sl@0
   499
    SELECT abs(a), abs(b) FROM t1
sl@0
   500
    EXCEPT
sl@0
   501
    SELECT abs(a), b FROM t1
sl@0
   502
  }
sl@0
   503
} {}
sl@0
   504
do_test tkt2927-5.16 {
sl@0
   505
  db eval {
sl@0
   506
    SELECT abs(a), abs(b) FROM t1
sl@0
   507
    EXCEPT
sl@0
   508
    SELECT abs(a), abs(b) FROM t1
sl@0
   509
  }
sl@0
   510
} {}
sl@0
   511
sl@0
   512
sl@0
   513
do_test tkt2927-6.1 {
sl@0
   514
  db eval {
sl@0
   515
    SELECT a, b FROM t1
sl@0
   516
    INTERSECT
sl@0
   517
    SELECT a, b FROM t1
sl@0
   518
    ORDER BY 1
sl@0
   519
  }
sl@0
   520
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   521
do_test tkt2927-6.2 {
sl@0
   522
  db eval {
sl@0
   523
    SELECT a, b FROM t1
sl@0
   524
    INTERSECT
sl@0
   525
    SELECT a, abs(b) FROM t1
sl@0
   526
    ORDER BY 1
sl@0
   527
  }
sl@0
   528
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   529
do_test tkt2927-6.3 {
sl@0
   530
  db eval {
sl@0
   531
    SELECT a, b FROM t1
sl@0
   532
    INTERSECT
sl@0
   533
    SELECT abs(a), b FROM t1
sl@0
   534
    ORDER BY 1
sl@0
   535
  }
sl@0
   536
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   537
do_test tkt2927-6.4 {
sl@0
   538
  db eval {
sl@0
   539
    SELECT a, b FROM t1
sl@0
   540
    INTERSECT
sl@0
   541
    SELECT abs(a), abs(b) FROM t1
sl@0
   542
    ORDER BY 1
sl@0
   543
  }
sl@0
   544
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   545
do_test tkt2927-6.5 {
sl@0
   546
  db eval {
sl@0
   547
    SELECT a, abs(b) FROM t1
sl@0
   548
    INTERSECT
sl@0
   549
    SELECT a, b FROM t1
sl@0
   550
    ORDER BY 1
sl@0
   551
  }
sl@0
   552
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   553
do_test tkt2927-6.6 {
sl@0
   554
  db eval {
sl@0
   555
    SELECT a, abs(b) FROM t1
sl@0
   556
    INTERSECT
sl@0
   557
    SELECT a, abs(b) FROM t1
sl@0
   558
    ORDER BY 1
sl@0
   559
  }
sl@0
   560
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   561
do_test tkt2927-6.7 {
sl@0
   562
  db eval {
sl@0
   563
    SELECT a, abs(b) FROM t1
sl@0
   564
    INTERSECT
sl@0
   565
    SELECT abs(a), b FROM t1
sl@0
   566
    ORDER BY 1
sl@0
   567
  }
sl@0
   568
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   569
do_test tkt2927-6.8 {
sl@0
   570
  db eval {
sl@0
   571
    SELECT a, abs(b) FROM t1
sl@0
   572
    INTERSECT
sl@0
   573
    SELECT abs(a), abs(b) FROM t1
sl@0
   574
    ORDER BY 1
sl@0
   575
  }
sl@0
   576
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   577
do_test tkt2927-6.9 {
sl@0
   578
  db eval {
sl@0
   579
    SELECT abs(a), b FROM t1
sl@0
   580
    INTERSECT
sl@0
   581
    SELECT a, b FROM t1
sl@0
   582
    ORDER BY 1
sl@0
   583
  }
sl@0
   584
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   585
do_test tkt2927-6.10 {
sl@0
   586
  db eval {
sl@0
   587
    SELECT abs(a), b FROM t1
sl@0
   588
    INTERSECT
sl@0
   589
    SELECT a, abs(b) FROM t1
sl@0
   590
    ORDER BY 1
sl@0
   591
  }
sl@0
   592
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   593
do_test tkt2927-6.11 {
sl@0
   594
  db eval {
sl@0
   595
    SELECT abs(a), b FROM t1
sl@0
   596
    INTERSECT
sl@0
   597
    SELECT abs(a), b FROM t1
sl@0
   598
    ORDER BY 1
sl@0
   599
  }
sl@0
   600
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   601
do_test tkt2927-6.12 {
sl@0
   602
  db eval {
sl@0
   603
    SELECT abs(a), b FROM t1
sl@0
   604
    INTERSECT
sl@0
   605
    SELECT abs(a), abs(b) FROM t1
sl@0
   606
    ORDER BY 1
sl@0
   607
  }
sl@0
   608
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   609
do_test tkt2927-6.13 {
sl@0
   610
  db eval {
sl@0
   611
    SELECT abs(a), abs(b) FROM t1
sl@0
   612
    INTERSECT
sl@0
   613
    SELECT a, b FROM t1
sl@0
   614
    ORDER BY 1
sl@0
   615
  }
sl@0
   616
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   617
do_test tkt2927-6.14 {
sl@0
   618
  db eval {
sl@0
   619
    SELECT abs(a), abs(b) FROM t1
sl@0
   620
    INTERSECT
sl@0
   621
    SELECT a, abs(b) FROM t1
sl@0
   622
    ORDER BY 1
sl@0
   623
  }
sl@0
   624
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   625
do_test tkt2927-6.15 {
sl@0
   626
  db eval {
sl@0
   627
    SELECT abs(a), abs(b) FROM t1
sl@0
   628
    INTERSECT
sl@0
   629
    SELECT abs(a), b FROM t1
sl@0
   630
    ORDER BY 1
sl@0
   631
  }
sl@0
   632
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   633
do_test tkt2927-6.16 {
sl@0
   634
  db eval {
sl@0
   635
    SELECT abs(a), abs(b) FROM t1
sl@0
   636
    INTERSECT
sl@0
   637
    SELECT abs(a), abs(b) FROM t1
sl@0
   638
    ORDER BY 1
sl@0
   639
  }
sl@0
   640
} {1 11 2 22 3 33 4 44 5 55}
sl@0
   641
sl@0
   642
# Ticket #3092 is the same bug.  But another test case never hurts.
sl@0
   643
#
sl@0
   644
do_test tkt2927-7.1 {
sl@0
   645
  db eval {
sl@0
   646
    CREATE TABLE host (
sl@0
   647
     hostname text not null primary key,
sl@0
   648
     consoleHost text,
sl@0
   649
     consolePort text
sl@0
   650
    );
sl@0
   651
    INSERT INTO "host" VALUES('aald04','aalp03','4');
sl@0
   652
    INSERT INTO "host" VALUES('aald17','aalp01','1');
sl@0
   653
    CREATE VIEW consolemap1a as
sl@0
   654
      select hostname, consolehost, '/dev/cuaD0.' || (consoleport-1) consoleport
sl@0
   655
        from host where consolehost='aalp01';
sl@0
   656
    CREATE VIEW consolemap1b as
sl@0
   657
      select hostname hostname, consolehost consolehost, '/dev/cuaD' ||
sl@0
   658
             substr('01',1+((consoleport-1)/16),1) ||
sl@0
   659
             substr('0123456789abcdef',1+((consoleport-1)%16),1) consoleport
sl@0
   660
        from host where consolehost='aalp03';
sl@0
   661
    CREATE VIEW consolemap1 as
sl@0
   662
      select * from consolemap1a
sl@0
   663
      union
sl@0
   664
      select * from consolemap1b;
sl@0
   665
    SELECT * from consolemap1b;
sl@0
   666
  }
sl@0
   667
} {aald04 aalp03 /dev/cuaD03}
sl@0
   668
do_test tkt2927-7.2 {
sl@0
   669
  db eval {
sl@0
   670
    SELECT * FROM consolemap1
sl@0
   671
  }
sl@0
   672
} {aald04 aalp03 /dev/cuaD03 aald17 aalp01 /dev/cuaD0.0}
sl@0
   673
sl@0
   674
finish_test