[go: up one dir, main page]

File: sql_messages.txt

package info (click to toggle)
kopanocore 8.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,400 kB
  • sloc: cpp: 175,422; python: 24,623; perl: 7,319; php: 6,056; sh: 2,172; makefile: 1,294; xml: 45; ansic: 1
file content (22 lines) | stat: -rw-r--r-- 919 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#
# Find parent<->child object (all kinds of objects) relationships where a
# parent references the child's entryid.
#
# Output is like:
# +-----+------+-------------+-------------+------+
# | id  | type | HEX(pp.tag) | hierarchyid | type |
# +-----+------+-------------+-------------+------+
# |   3 |    1 | 35E0        |           5 |    3 |
#
# Meaning: object 3 (of type 1, MAPI_STORE) has a property 0x35E0
# (PR_IPM_SUBTREE_ENTRYID) which contains the entryid of object 5
# (type 3, MAPI_FOLDER).
#
# Adding WHERE ch.type=5 (MAPI_MESSAGE) hence checks if any message's entryid
# is referenced by something else.
#
SELECT ph.id,ph.type,HEX(pp.tag),cip.hierarchyid,ch.type
FROM hierarchy AS ph
INNER JOIN properties AS pp ON ph.id=pp.hierarchyid AND pp.val_binary IS NOT NULL
INNER JOIN indexedproperties AS cip ON pp.val_binary=cip.val_binary AND cip.tag=4095
INNER JOIN hierarchy AS ch ON cip.hierarchyid=ch.id;