@@ -4,6 +4,81 @@ SELECT create_table_with_encrypted();
4
4
SELECT seed_encrypted_json();
5
5
6
6
7
+ --
8
+ -- ORE - eql_v2_encrypted <= eql_v2_encrypted
9
+ --
10
+ DO $$
11
+ DECLARE
12
+ e eql_v2_encrypted;
13
+ ore_term jsonb;
14
+ BEGIN
15
+
16
+ -- Record with a Numeric ORE term of 42
17
+ e := create_encrypted_ore_json(42 );
18
+ PERFORM seed_encrypted(e);
19
+
20
+ PERFORM assert_result(
21
+ ' eql_v2_encrypted <= eql_v2_encrypted' ,
22
+ format(' SELECT e FROM encrypted WHERE e <= %L::eql_v2_encrypted' , e));
23
+
24
+ PERFORM assert_count(
25
+ format(' eql_v2_encrypted <= eql_v2_encrypted' ),
26
+ format(' SELECT e FROM encrypted WHERE e <= %L;' , e),
27
+ 4 );
28
+
29
+ e := create_encrypted_ore_json(20 );
30
+
31
+ PERFORM assert_result(
32
+ ' eql_v2_encrypted <= eql_v2_encrypted' ,
33
+ format(' SELECT e FROM encrypted WHERE e <= %L::eql_v2_encrypted' , e));
34
+
35
+ PERFORM assert_count(
36
+ format(' eql_v2_encrypted <= eql_v2_encrypted' ),
37
+ format(' SELECT e FROM encrypted WHERE e <= %L;' , e),
38
+ 2 );
39
+ END;
40
+ $$ LANGUAGE plpgsql;
41
+
42
+
43
+ --
44
+ -- ORE - eql_v2.lte(a eql_v2_encrypted, b eql_v2_encrypted)
45
+ --
46
+ DO $$
47
+ DECLARE
48
+ e eql_v2_encrypted;
49
+ ore_term jsonb;
50
+ BEGIN
51
+ -- Reset data
52
+ PERFORM seed_encrypted_json();
53
+
54
+ -- Record with a Numeric ORE term of 42
55
+ e := create_encrypted_ore_json(42 );
56
+ PERFORM seed_encrypted(e);
57
+
58
+ PERFORM assert_result(
59
+ ' eql_v2.lte(a eql_v2_encrypted, b eql_v2_encrypted)' ,
60
+ format(' SELECT e FROM encrypted WHERE eql_v2.lte(e, %L)' , e));
61
+
62
+ -- include
63
+ PERFORM assert_count(
64
+ ' eql_v2.lte(a eql_v2_encrypted, b eql_v2_encrypted)' ,
65
+ format(' SELECT e FROM encrypted WHERE eql_v2.lte(e, %L)' , e),
66
+ 4 );
67
+
68
+ -- Record with a Numeric ORE term of 30
69
+ e := create_encrypted_ore_json(30 );
70
+
71
+ PERFORM assert_result(
72
+ ' eql_v2.get(a eql_v2_encrypted, b eql_v2_encrypted)' ,
73
+ format(' SELECT e FROM encrypted WHERE eql_v2.lte(e, %L)' , e));
74
+
75
+ PERFORM assert_count(
76
+ ' eql_v2.get(a eql_v2_encrypted, b eql_v2_encrypted)' ,
77
+ format(' SELECT e FROM encrypted WHERE eql_v2.lte(e, %L)' , e),
78
+ 3 );
79
+ END;
80
+ $$ LANGUAGE plpgsql;
81
+
7
82
-- ------------------------------------------------------------------------
8
83
-- ------------------------------------------------------------------------
9
84
--
@@ -29,8 +104,6 @@ DECLARE
29
104
-- extract the term at $.n returned as eql_v2_encrypted
30
105
term := sv- > ' 2517068c0d1f9d4d41d2c666211f785e' ::text ;
31
106
32
- RAISE NOTICE ' term: %' , term;
33
-
34
107
-- -- -- -- $.n
35
108
PERFORM assert_result(
36
109
format(' eql_v2_encrypted <= eql_v2_encrypted with ore_cllw_u64_8 index term' ),
0 commit comments