OLD | NEW |
1 # 2001 September 15 | 1 # 2001 September 15 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 do_test in-12.5 { | 397 do_test in-12.5 { |
398 catchsql { | 398 catchsql { |
399 SELECT * FROM t2 WHERE a IN ( | 399 SELECT * FROM t2 WHERE a IN ( |
400 SELECT a, b FROM t3 INTERSECT SELECT a, b FROM t2 | 400 SELECT a, b FROM t3 INTERSECT SELECT a, b FROM t2 |
401 ); | 401 ); |
402 } | 402 } |
403 } {1 {only a single result allowed for a SELECT that is part of an expression}} | 403 } {1 {only a single result allowed for a SELECT that is part of an expression}} |
404 do_test in-12.6 { | 404 do_test in-12.6 { |
405 catchsql { | 405 catchsql { |
406 SELECT * FROM t2 WHERE a IN ( | 406 SELECT * FROM t2 WHERE a IN ( |
407 SELECT a FROM t3 UNION ALL SELECT a, b FROM t2 | 407 SELECT a, b FROM t3 UNION ALL SELECT a FROM t2 |
408 ); | 408 ); |
409 } | 409 } |
410 } {1 {SELECTs to the left and right of UNION ALL do not have the same number of
result columns}} | 410 } {1 {SELECTs to the left and right of UNION ALL do not have the same number of
result columns}} |
411 do_test in-12.7 { | 411 do_test in-12.7 { |
412 catchsql { | 412 catchsql { |
413 SELECT * FROM t2 WHERE a IN ( | 413 SELECT * FROM t2 WHERE a IN ( |
414 SELECT a FROM t3 UNION SELECT a, b FROM t2 | 414 SELECT a, b FROM t3 UNION SELECT a FROM t2 |
415 ); | 415 ); |
416 } | 416 } |
417 } {1 {SELECTs to the left and right of UNION do not have the same number of resu
lt columns}} | 417 } {1 {SELECTs to the left and right of UNION do not have the same number of resu
lt columns}} |
418 do_test in-12.8 { | 418 do_test in-12.8 { |
419 catchsql { | 419 catchsql { |
420 SELECT * FROM t2 WHERE a IN ( | 420 SELECT * FROM t2 WHERE a IN ( |
421 SELECT a FROM t3 EXCEPT SELECT a, b FROM t2 | 421 SELECT a, b FROM t3 EXCEPT SELECT a FROM t2 |
422 ); | 422 ); |
423 } | 423 } |
424 } {1 {SELECTs to the left and right of EXCEPT do not have the same number of res
ult columns}} | 424 } {1 {SELECTs to the left and right of EXCEPT do not have the same number of res
ult columns}} |
425 do_test in-12.9 { | 425 do_test in-12.9 { |
426 catchsql { | 426 catchsql { |
427 SELECT * FROM t2 WHERE a IN ( | 427 SELECT * FROM t2 WHERE a IN ( |
428 SELECT a FROM t3 INTERSECT SELECT a, b FROM t2 | 428 SELECT a, b FROM t3 INTERSECT SELECT a FROM t2 |
429 ); | 429 ); |
430 } | 430 } |
431 } {1 {SELECTs to the left and right of INTERSECT do not have the same number of
result columns}} | 431 } {1 {SELECTs to the left and right of INTERSECT do not have the same number of
result columns}} |
432 } | 432 } |
433 | 433 |
| 434 do_test in-12.10 { |
| 435 catchsql { |
| 436 SELECT * FROM t2 WHERE a IN ( |
| 437 SELECT a FROM t3 UNION ALL SELECT a, b FROM t2 |
| 438 ); |
| 439 } |
| 440 } {1 {only a single result allowed for a SELECT that is part of an expression}} |
| 441 do_test in-12.11 { |
| 442 catchsql { |
| 443 SELECT * FROM t2 WHERE a IN ( |
| 444 SELECT a FROM t3 UNION SELECT a, b FROM t2 |
| 445 ); |
| 446 } |
| 447 } {1 {only a single result allowed for a SELECT that is part of an expression}} |
| 448 do_test in-12.12 { |
| 449 catchsql { |
| 450 SELECT * FROM t2 WHERE a IN ( |
| 451 SELECT a FROM t3 EXCEPT SELECT a, b FROM t2 |
| 452 ); |
| 453 } |
| 454 } {1 {only a single result allowed for a SELECT that is part of an expression}} |
| 455 do_test in-12.13 { |
| 456 catchsql { |
| 457 SELECT * FROM t2 WHERE a IN ( |
| 458 SELECT a FROM t3 INTERSECT SELECT a, b FROM t2 |
| 459 ); |
| 460 } |
| 461 } {1 {only a single result allowed for a SELECT that is part of an expression}} |
| 462 |
434 | 463 |
435 #------------------------------------------------------------------------ | 464 #------------------------------------------------------------------------ |
436 # The following tests check that NULL is handled correctly when it | 465 # The following tests check that NULL is handled correctly when it |
437 # appears as part of a set of values on the right-hand side of an | 466 # appears as part of a set of values on the right-hand side of an |
438 # IN or NOT IN operator. | 467 # IN or NOT IN operator. |
439 # | 468 # |
440 # When it appears in such a set, NULL is handled as an "unknown value". | 469 # When it appears in such a set, NULL is handled as an "unknown value". |
441 # If, because of the unknown value in the set, the result of the expression | 470 # If, because of the unknown value in the set, the result of the expression |
442 # cannot be determined, then it itself evaluates to NULL. | 471 # cannot be determined, then it itself evaluates to NULL. |
443 # | 472 # |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 SELECT * FROM a WHERE id NOT IN (SELECT id FROM b); | 600 SELECT * FROM a WHERE id NOT IN (SELECT id FROM b); |
572 } | 601 } |
573 } {} | 602 } {} |
574 | 603 |
575 | 604 |
576 do_test in-13.X { | 605 do_test in-13.X { |
577 db nullvalue "" | 606 db nullvalue "" |
578 } {} | 607 } {} |
579 | 608 |
580 finish_test | 609 finish_test |
OLD | NEW |