File: qualifiedIdentifiers.out

package info (click to toggle)
derby 10.14.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 78,896 kB
  • sloc: java: 691,930; sql: 42,686; xml: 20,511; sh: 3,373; sed: 96; makefile: 60
file content (108 lines) | stat: -rw-r--r-- 3,637 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
ij> --
--   Licensed to the Apache Software Foundation (ASF) under one or more
--   contributor license agreements.  See the NOTICE file distributed with
--   this work for additional information regarding copyright ownership.
--   The ASF licenses this file to You under the Apache License, Version 2.0
--   (the "License"); you may not use this file except in compliance with
--   the License.  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--   Unless required by applicable law or agreed to in writing, software
--   distributed under the License is distributed on an "AS IS" BASIS,
--   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--   See the License for the specific language governing permissions and
--   limitations under the License.
--
-- This test will cover the qualified identifiers introduced by DERBY-4550
connect 'jdbc:derby:wombat;user=fred' as DERBY4550_1;
ij(DERBY4550_1)> create table t1(a int, b int);
0 rows inserted/updated/deleted
ij(DERBY4550_1)> insert into t1(a,b) values (1,100), (2,200), (3,300);
3 rows inserted/updated/deleted
ij(DERBY4550_1)> prepare fred_select as 'select a from t1';
ij(DERBY4550_1)> -- setup destination db
connect 'jdbc:derby:wombat;user=alice' as DERBY4550_2;
ij(DERBY4550_2)> create table t2(a int);
0 rows inserted/updated/deleted
ij(DERBY4550_2)> -- execute prepared statements
autocommit off;
ij(DERBY4550_2)> execute fred_select@DERBY4550_1;
A          
-----------
1          
2          
3          
ij(DERBY4550_2)> execute 'insert into t2(a) values(?)' using fred_select@DERBY4550_1;
1 row inserted/updated/deleted
1 row inserted/updated/deleted
1 row inserted/updated/deleted
ij(DERBY4550_2)> commit;
ij(DERBY4550_2)> remove fred_select@DERBY4550_1;
ij(DERBY4550_2)> -- check result
select a from t2;
A          
-----------
1          
2          
3          
ij(DERBY4550_2)> -- prepare in a different connection/switch/execute
prepare fred_select2@DERBY4550_1 as 'select b from t1';
ij(DERBY4550_2)> set connection DERBY4550_1;
ij(DERBY4550_1)> execute fred_select2;
B          
-----------
100        
200        
300        
ij(DERBY4550_1)> remove fred_select2;
ij(DERBY4550_1)> set connection DERBY4550_2;
ij(DERBY4550_2)> -- cursors
get scroll insensitive cursor fred_cursor@DERBY4550_1 as 'select b from t1';
ij(DERBY4550_2)> next fred_cursor@DERBY4550_1;
B          
-----------
100        
ij(DERBY4550_2)> -- getcurrentrownumber fred_cursor@DERBY4550_1;
last fred_cursor@DERBY4550_1;
B          
-----------
300        
ij(DERBY4550_2)> previous fred_cursor@DERBY4550_1;
B          
-----------
200        
ij(DERBY4550_2)> first fred_cursor@DERBY4550_1;
B          
-----------
100        
ij(DERBY4550_2)> after last fred_cursor@DERBY4550_1;
No current row
ij(DERBY4550_2)> before first fred_cursor@DERBY4550_1;
No current row
ij(DERBY4550_2)> relative 2 fred_cursor@DERBY4550_1;
B          
-----------
200        
ij(DERBY4550_2)> absolute 1 fred_cursor@DERBY4550_1;
B          
-----------
100        
ij(DERBY4550_2)> close fred_cursor@DERBY4550_1;
ij(DERBY4550_2)> -- non-existant connection
prepare fred_select@XXXX as 'values(1)';
IJ ERROR: No connection exists with the name XXXX
ij(DERBY4550_2)> -- async statements
async a@DERBY4550_1 'select a from t1';
ij(DERBY4550_2)> wait for a@DERBY4550_1;
A          
-----------
1          
2          
3          
ij(DERBY4550_2)> -- non existant statement
wait for xxxx@DERBY4550_1;
IJ ERROR: No async statement exists with the name XXXX@DERBY4550_1
ij(DERBY4550_2)> disconnect DERBY4550_2;
ij> disconnect DERBY4550_1;
ij>