1
/* wc-test-queries.sql -- queries used to verify wc metadata from
4
* ====================================================================
5
* Licensed to the Apache Software Foundation (ASF) under one
6
* or more contributor license agreements. See the NOTICE file
7
* distributed with this work for additional information
8
* regarding copyright ownership. The ASF licenses this file
9
* to you under the Apache License, Version 2.0 (the
10
* "License"); you may not use this file except in compliance
11
* with the License. You may obtain a copy of the License at
13
* http://www.apache.org/licenses/LICENSE-2.0
15
* Unless required by applicable law or agreed to in writing,
16
* software distributed under the License is distributed on an
17
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18
* KIND, either express or implied. See the License for the
19
* specific language governing permissions and limitations
21
* ====================================================================
24
-- STMT_SELECT_NODES_INFO
25
SELECT op_depth, n.presence, n.local_relpath, revision,
26
repos_path, file_external, def_local_relpath, moved_to, moved_here,
29
LEFT OUTER JOIN externals e
31
AND n.local_relpath = e.local_relpath
33
AND (n.local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(n.local_relpath, ?2))
35
-- STMT_SELECT_ACTUAL_INFO
39
AND conflict_data is NOT NULL
40
AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
46
INSERT INTO nodes (local_relpath, op_depth, presence, repos_path,
47
revision, parent_relpath, moved_to, moved_here,
48
properties, wc_id, repos_id, kind,
50
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, 1,
51
CASE WHEN ?3 != 'base-deleted' THEN 1 END,
53
CASE WHEN ?3 in ('normal', 'incomplete')
57
DELETE FROM actual_node;
60
INSERT INTO actual_node (local_relpath, parent_relpath, changelist, wc_id)
61
VALUES (?1, ?2, ?3, 1)
63
-- STMT_ENSURE_EMPTY_PRISTINE
64
INSERT OR IGNORE INTO pristine (checksum, md5_checksum, size, refcount)
65
VALUES ('$sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709',
66
'$md5 $d41d8cd98f00b204e9800998ecf8427e',
69
-- STMT_NODES_SET_FILE
72
checksum = '$sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709',
74
WHERE wc_id = 1 and local_relpath = ?1
76
-- STMT_SELECT_ALL_ACTUAL
77
SELECT local_relpath FROM actual_node WHERE wc_id = 1