vorax 0.4.2 → 5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README.md +4 -29
  2. data/vorax.gemspec +3 -11
  3. metadata +4 -92
  4. data/.rspec +0 -1
  5. data/Rakefile +0 -30
  6. data/lib/vorax.rb +0 -60
  7. data/lib/vorax/base_funnel.rb +0 -30
  8. data/lib/vorax/output/html_convertor.rb +0 -120
  9. data/lib/vorax/output/html_funnel.rb +0 -79
  10. data/lib/vorax/output/pagezip_convertor.rb +0 -20
  11. data/lib/vorax/output/tablezip_convertor.rb +0 -22
  12. data/lib/vorax/output/vertical_convertor.rb +0 -53
  13. data/lib/vorax/output/zip_convertor.rb +0 -117
  14. data/lib/vorax/parser/argument.rb~ +0 -125
  15. data/lib/vorax/parser/conn_string.rb +0 -104
  16. data/lib/vorax/parser/grammars/alias.rb +0 -904
  17. data/lib/vorax/parser/grammars/alias.rl +0 -138
  18. data/lib/vorax/parser/grammars/column.rb +0 -454
  19. data/lib/vorax/parser/grammars/column.rl +0 -64
  20. data/lib/vorax/parser/grammars/common.rl +0 -107
  21. data/lib/vorax/parser/grammars/declare.rb +0 -9606
  22. data/lib/vorax/parser/grammars/declare.rl +0 -160
  23. data/lib/vorax/parser/grammars/for_block.rb +0 -440
  24. data/lib/vorax/parser/grammars/for_block.rl +0 -73
  25. data/lib/vorax/parser/grammars/plsql_def.rb +0 -539
  26. data/lib/vorax/parser/grammars/plsql_def.rl +0 -73
  27. data/lib/vorax/parser/grammars/statement.rb +0 -925
  28. data/lib/vorax/parser/grammars/statement.rl +0 -83
  29. data/lib/vorax/parser/parser.rb +0 -344
  30. data/lib/vorax/parser/plsql_structure.rb +0 -222
  31. data/lib/vorax/parser/plsql_walker.rb +0 -143
  32. data/lib/vorax/parser/statement_inspector.rb~ +0 -52
  33. data/lib/vorax/parser/stmt_inspector.rb +0 -78
  34. data/lib/vorax/parser/target_ref.rb +0 -110
  35. data/lib/vorax/sqlplus.rb +0 -273
  36. data/lib/vorax/version.rb +0 -7
  37. data/lib/vorax/vorax_io.rb +0 -70
  38. data/spec/column_spec.rb +0 -40
  39. data/spec/conn_string_spec.rb +0 -53
  40. data/spec/declare_spec.rb +0 -281
  41. data/spec/pagezip_spec.rb +0 -153
  42. data/spec/parser_spec.rb +0 -352
  43. data/spec/plsql_structure_spec.rb +0 -68
  44. data/spec/spec_helper.rb +0 -13
  45. data/spec/sql/create_objects.sql +0 -69
  46. data/spec/sql/dbms_crypto.spc +0 -339
  47. data/spec/sql/dbms_stats.spc +0 -4097
  48. data/spec/sql/drop_user.sql +0 -10
  49. data/spec/sql/muci.spc +0 -26
  50. data/spec/sql/setup_user.sql +0 -22
  51. data/spec/sql/test.fnc +0 -12
  52. data/spec/sql/test.pkg +0 -83
  53. data/spec/sqlplus_spec.rb +0 -52
  54. data/spec/stmt_inspector_spec.rb +0 -96
  55. data/spec/tablezip_spec.rb +0 -111
  56. data/spec/vertical_spec.rb +0 -150
@@ -1,7 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Vorax
4
-
5
- VERSION = '0.4.2' unless defined?(VERSION)
6
-
7
- end
@@ -1,70 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- module Vorax
4
-
5
- # Implements an IO pipe to link the stdin and stdout handlers of the
6
- # sqlplus process to the ends of this pipe. This is required for Windows
7
- # processes only. On Unix it's enough to use a builtin IO object.
8
- class VoraxIO < IO
9
-
10
- # A proxy for the original read_nonblock method
11
- alias :old_read_nonblock :read_nonblock
12
-
13
- # Creates a new IO.
14
- def initialize(*args)
15
- super(*args)
16
- if ChildProcess.windows?
17
- require 'Win32API'
18
- @hFile = ChildProcess::Windows::Lib.get_osfhandle(fileno)
19
- peek_params = [
20
- 'L', # handle to pipe to copy from
21
- 'L', # pointer to data buffer
22
- 'L', # size, in bytes, of data buffer
23
- 'L', # pointer to number of bytes read
24
- 'P', # pointer to total number of bytes available
25
- 'L'] # pointer to unread bytes in this message
26
- @peekNamedPipe = Win32API.new("kernel32", "PeekNamedPipe", peek_params, 'I')
27
- read_params = [
28
- 'L', # handle of file to read
29
- 'P', # pointer to buffer that receives data
30
- 'L', # number of bytes to read
31
- 'P', # pointer to number of bytes read
32
- 'L'] #pointer to structure for data
33
- @readFile = Win32API.new("kernel32", "ReadFile", read_params, 'I')
34
- end
35
- end
36
-
37
- # Read in nonblock mode from the pipe.
38
- #
39
- # @param bytes [int] the number of bytes to be read at once
40
- # @see IO.read_nonblock
41
- def read_nonblock(bytes)
42
- if ChildProcess.windows?
43
- read_file(peek)
44
- else
45
- old_read_nonblock(bytes)
46
- end
47
- end
48
-
49
- private
50
-
51
- def peek
52
- available = [0].pack('I')
53
- if @peekNamedPipe.Call(@hFile, 0, 0, 0, available, 0).zero?
54
- raise IOError, 'Named pipe unavailable'
55
- end
56
- available.unpack('I')[0]
57
- end
58
-
59
- def read_file(bytes)
60
- if bytes > 0
61
- number = [0].pack('I')
62
- buffer = ' ' * bytes
63
- return '' if @readFile.call(@hFile, buffer, bytes, number, 0).zero?
64
- buffer[0...number.unpack('I')[0]]
65
- end
66
- end
67
-
68
- end
69
-
70
- end
@@ -1,40 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- include Vorax
4
-
5
- describe 'column' do
6
-
7
- it 'should work with multiple columns' do
8
- Parser::Column.new.walk('col1, col2, f(a, b, c) x, 3+5, t.*, owner.tab.col y').should eq(["col1", "col2", "x", "t.*", "y"])
9
- end
10
-
11
- it 'should work with one column' do
12
- Parser::Column.new.walk('col1').should eq(["col1"])
13
- end
14
-
15
- it 'should work with one column with alias' do
16
- Parser::Column.new.walk('col1 as x').should eq(["x"])
17
- Parser::Column.new.walk('col1 y').should eq(["y"])
18
- end
19
-
20
- it 'should work with referenced columns' do
21
- Parser::Column.new.walk('tab.col1').should eq(["tab.col1"])
22
- Parser::Column.new.walk('owner.tab.col2').should eq(["owner.tab.col2"])
23
- Parser::Column.new.walk('"owner"."tab wow".col2').should eq(['"owner"."tab wow".col2'])
24
- end
25
-
26
- it 'should work with expressions' do
27
- Parser::Column.new.walk('(select 1 from dual) x, 3+2').should eq(["x"])
28
- end
29
-
30
- it 'should ignore functions without alias' do
31
- Parser::Column.new.walk('f(1, 2, 3), my_func(col)').should eq([])
32
- end
33
-
34
- it 'should work with nested expressions' do
35
- Parser::Column.new.walk('f(1, g(2), x(3, 2, f(10))), my_func(col)').should eq([])
36
- end
37
-
38
- end
39
-
40
-
@@ -1,53 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- include Vorax
4
-
5
- describe 'sqlplus' do
6
-
7
- before(:all) do# {{{
8
- @cstr = Parser::ConnString.new
9
- end# }}}
10
-
11
- it 'should parse a connection string containing just the user' do# {{{
12
- @cstr.parse('scott')[:user].should eq('scott')
13
- end# }}}
14
-
15
- it 'should parse a connection string containing the user and the password' do# {{{
16
- @cstr.parse('scott/tiger')[:user].should eq('scott')
17
- end# }}}
18
-
19
- it 'should parse a connection string containing the user and the database' do# {{{
20
- @cstr.parse('scott@db')[:user].should eq('scott')
21
- end# }}}
22
-
23
- it 'should parse a connection string containing the user with special chars' do# {{{
24
- @cstr.parse('"scott@man"@db')[:user].should eq('scott@man')
25
- @cstr.parse('"scott/man"@db')[:user].should eq('scott/man')
26
- end# }}}
27
-
28
- it 'should parse a connection string containing an empty user' do# {{{
29
- @cstr.parse('/')[:user].should eq('')
30
- end# }}}
31
-
32
- it 'should extract the role' do# {{{
33
- @cstr.parse('talek/muci as sysdba').should eq({:prompt_for => nil, :user =>'talek', :password => 'muci', :db => '', :role => 'sysdba'})
34
- @cstr.parse('talek/"muciBuci123" as SYSASM').should eq({:prompt_for => nil, :user =>'talek', :password => 'muciBuci123', :db => '', :role => 'sysasm'})
35
- @cstr.parse('scott/tiger@//fox:1521/fd.fox.ro as sysoper').should eq({:prompt_for => nil, :user =>'scott', :password => 'tiger', :db => '//fox:1521/fd.fox.ro', :role => 'sysoper'})
36
- @cstr.parse('scott@//fox:1521/fd.fox.ro as sysoper').should eq({:prompt_for => :password, :user =>'scott', :password => '', :db => '//fox:1521/fd.fox.ro', :role => 'sysoper'})
37
- end# }}}
38
-
39
- it 'should work with OS auth' do# {{{
40
- @cstr.parse('/').should eq({:user =>'', :password => '', :db => '', :role => '', :prompt_for => nil})
41
- @cstr.parse('/ as sysdba').should eq({:prompt_for => nil, :user =>'', :password => '', :db => '', :role => 'sysdba'})
42
- @cstr.parse('/@db').should eq({:prompt_for => nil, :user =>'', :password => '', :db => 'db', :role => ''})
43
- end# }}}
44
-
45
- it 'should prompt for password when just the user is given' do# {{{
46
- @cstr.parse('scott').should eq({:user =>'scott', :password => '', :db => '', :role => '', :prompt_for => :password})
47
- end# }}}
48
-
49
- it 'should prompt for user when nothing is given' do# {{{
50
- @cstr.parse('').should eq({:user =>'', :password => '', :db => '', :role => '', :prompt_for => :user})
51
- end# }}}
52
-
53
- end
@@ -1,281 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- include Vorax
4
- include Parser
5
-
6
- describe 'package_spec' do
7
-
8
- it 'should get the vim format' do
9
- text = File.open("spec/sql/muci.spc", 'rb') { |file| file.read }
10
- parser = Vorax::Parser::Declare.new(text)
11
- parser.to_vim.should == %q[[ {'name' : "MY_CONSTANT1", 'is_a' : "constant", 'type' : "varchar2", 'captured_text' : "MY_CONSTANT1 constant varchar2(100) := 'abc';"},{'name' : "MY_CONSTANT2", 'is_a' : "constant", 'type' : "integer", 'captured_text' : "MY_CONSTANT2 constant integer := 10;"},{'name' : "ex_no_data_found", 'is_a' : "exception", 'type' : "exception", 'captured_text' : "ex_no_data_found exception;"},{'name' : "ex_custom", 'is_a' : "exception", 'type' : "exception", 'captured_text' : "ex_custom exception;"},{'name' : "my_cursor", 'is_a' : "cursor", 'type' : "", 'captured_text' : "cursor my_cursor is\n select * from user_tables;"},{'name' : "population_type", 'is_a' : "type", 'type' : "table", 'captured_text' : "type population_type is table of varchar2(100);"},{'name' : "g_var1", 'is_a' : "variable", 'type' : "integer", 'captured_text' : "g_var1 integer;"},{'name' : "g_var2", 'is_a' : "variable", 'type' : "varchar2", 'captured_text' : "g_var2 varchar2(100) := 'xyz';"},{'name' : "g_var3", 'is_a' : "variable", 'type' : "dual.dummy%type", 'captured_text' : "g_var3 dual.dummy%type;"},{'name' : "g_var4", 'is_a' : "variable", 'type' : "all_objects%rowtype", 'captured_text' : "g_var4 all_objects%rowtype;"},{'name' : "my_proc", 'is_a' : "procedure", 'type' : "", 'captured_text' : "procedure my_proc(p1 integer);"},{'name' : "my_func", 'is_a' : "function", 'type' : "", 'captured_text' : "function my_func(param1 varchar2, param2 boolean := true) return boolean;"} ]]
12
- end
13
-
14
- it 'should work with a simple package' do
15
- text = File.open("spec/sql/muci.spc", 'rb') { |file| file.read }
16
- parser = Vorax::Parser::Declare.new(text)
17
- parser.items.length.should == 12
18
- parser.items.include?(DeclareItem.new("MY_CONSTANT1",
19
- :constant,
20
- "varchar2",
21
- "MY_CONSTANT1 constant varchar2(100) := 'abc';")).should be_true
22
- parser.items.include?(DeclareItem.new("MY_CONSTANT2",
23
- :constant,
24
- "integer",
25
- "MY_CONSTANT2 constant integer := 10;")).should be_true
26
- parser.items.include?(DeclareItem.new("ex_no_data_found",
27
- :exception,
28
- "exception",
29
- "ex_no_data_found exception;")).should be_true
30
- parser.items.include?(DeclareItem.new("ex_custom",
31
- :exception,
32
- "exception",
33
- "ex_custom exception;")).should be_true
34
- parser.items.include?(DeclareItem.new("my_cursor",
35
- :cursor,
36
- nil,
37
- "cursor my_cursor is\n select * from user_tables;")).should be_true
38
- parser.items.include?(DeclareItem.new("population_type",
39
- :type,
40
- "table",
41
- "type population_type is table of varchar2(100);")).should be_true
42
- parser.items.include?(DeclareItem.new("g_var1",
43
- :variable,
44
- "integer",
45
- "g_var1 integer;")).should be_true
46
- parser.items.include?(DeclareItem.new("g_var2",
47
- :variable,
48
- "varchar2",
49
- "g_var2 varchar2(100) := 'xyz';")).should be_true
50
- parser.items.include?(DeclareItem.new("g_var3",
51
- :variable,
52
- "dual.dummy%type",
53
- "g_var3 dual.dummy%type;")).should be_true
54
- parser.items.include?(DeclareItem.new("g_var4",
55
- :variable,
56
- "all_objects%rowtype",
57
- "g_var4 all_objects%rowtype;")).should be_true
58
- parser.items.include?(DeclareItem.new("my_proc",
59
- :procedure,
60
- nil,
61
- "procedure my_proc(p1 integer);")).should be_true
62
- parser.items.include?(DeclareItem.new("my_func",
63
- :function,
64
- nil,
65
- "function my_func(param1 varchar2, param2 boolean := true) return boolean;")).should be_true
66
- end
67
-
68
- it 'should work with a big package spec' do
69
- text = File.open('spec/sql/dbms_stats.spc', 'rb') { |file| file.read }
70
- parser = Vorax::Parser::Declare.new(text)
71
- parser.items.include?(DeclareItem.new("numarray", :type, "varray", "type numarray is varray(256) of number;")).should be_true
72
- parser.items.include?(DeclareItem.new("datearray", :type, "varray", "type datearray is varray(256) of date;")).should be_true
73
- parser.items.include?(DeclareItem.new("chararray", :type, "varray", "type chararray is varray(256) of varchar2(4000);")).should be_true
74
- parser.items.include?(DeclareItem.new("rawarray", :type, "varray", "type rawarray is varray(256) of raw(2000);")).should be_true
75
- parser.items.include?(DeclareItem.new("fltarray", :type, "varray", "type fltarray is varray(256) of binary_float;")).should be_true
76
- parser.items.include?(DeclareItem.new("dblarray", :type, "varray", "type dblarray is varray(256) of binary_double;")).should be_true
77
- parser.items.include?(DeclareItem.new("StatRec", :type, "record", "type StatRec is record (\r\n epc number,\r\n minval raw(2000),\r\n maxval raw(2000),\r\n bkvals numarray,\r\n novals numarray,\r\n chvals chararray,\r\n eavs number);")).should be_true
78
- parser.items.include?(DeclareItem.new("ObjectElem", :type, "record", "type ObjectElem is record (\r\n ownname varchar2(32), objtype varchar2(6), objname varchar2(32), partname varchar2(32), subpartname varchar2(32) );")).should be_true
79
- parser.items.include?(DeclareItem.new("ObjectTab", :type, "table", "type ObjectTab is table of ObjectElem;")).should be_true
80
- parser.items.include?(DeclareItem.new("DiffRepElem", :type, "record", "type DiffRepElem is record (\r\n report clob, maxdiffpct number);")).should be_true
81
- parser.items.include?(DeclareItem.new("DiffRepTab", :type, "table", "type DiffRepTab is table of DiffRepElem;")).should be_true
82
- parser.items.include?(DeclareItem.new("CContext", :type, "varray", "type CContext is varray(10) of varchar2(100);")).should be_true
83
- parser.items.include?(DeclareItem.new("AUTO_CASCADE", :constant, "BOOLEAN", "AUTO_CASCADE CONSTANT BOOLEAN := null;")).should be_true
84
- parser.items.include?(DeclareItem.new("AUTO_INVALIDATE", :constant, "BOOLEAN", "AUTO_INVALIDATE CONSTANT BOOLEAN := null;")).should be_true
85
- parser.items.include?(DeclareItem.new("AUTO_SAMPLE_SIZE", :constant, "NUMBER", "AUTO_SAMPLE_SIZE CONSTANT NUMBER := 0;")).should be_true
86
- parser.items.include?(DeclareItem.new("DEFAULT_DEGREE", :constant, "NUMBER", "DEFAULT_DEGREE CONSTANT NUMBER := 32767;")).should be_true
87
- parser.items.include?(DeclareItem.new("AUTO_DEGREE", :constant, "NUMBER", "AUTO_DEGREE CONSTANT NUMBER := 32768;")).should be_true
88
- parser.items.include?(DeclareItem.new("DEFAULT_CASCADE", :constant, "BOOLEAN", "DEFAULT_CASCADE CONSTANT BOOLEAN := null;")).should be_true
89
- parser.items.include?(DeclareItem.new("DEFAULT_DEGREE_VALUE", :constant, "NUMBER", "DEFAULT_DEGREE_VALUE CONSTANT NUMBER := 32766;")).should be_true
90
- parser.items.include?(DeclareItem.new("DEFAULT_ESTIMATE_PERCENT", :constant, "NUMBER", "DEFAULT_ESTIMATE_PERCENT CONSTANT NUMBER := 101;")).should be_true
91
- parser.items.include?(DeclareItem.new("DEFAULT_METHOD_OPT", :constant, "VARCHAR2", "DEFAULT_METHOD_OPT CONSTANT VARCHAR2(1) := 'Z';")).should be_true
92
- parser.items.include?(DeclareItem.new("DEFAULT_NO_INVALIDATE", :constant, "BOOLEAN", "DEFAULT_NO_INVALIDATE CONSTANT BOOLEAN := null;")).should be_true
93
- parser.items.include?(DeclareItem.new("DEFAULT_GRANULARITY", :constant, "VARCHAR2", "DEFAULT_GRANULARITY CONSTANT VARCHAR2(1) := 'Z';")).should be_true
94
- parser.items.include?(DeclareItem.new("DEFAULT_PUBLISH", :constant, "BOOLEAN", "DEFAULT_PUBLISH CONSTANT BOOLEAN := true;")).should be_true
95
- parser.items.include?(DeclareItem.new("DEFAULT_INCREMENTAL", :constant, "BOOLEAN", "DEFAULT_INCREMENTAL CONSTANT BOOLEAN := false;")).should be_true
96
- parser.items.include?(DeclareItem.new("DEFAULT_STALE_PERCENT", :constant, "NUMBER", "DEFAULT_STALE_PERCENT CONSTANT NUMBER := 10;")).should be_true
97
- parser.items.include?(DeclareItem.new("DEFAULT_AUTOSTATS_TARGET", :constant, "VARCHAR2", "DEFAULT_AUTOSTATS_TARGET CONSTANT VARCHAR2(1) := 'Z';")).should be_true
98
- parser.items.include?(DeclareItem.new("DEFAULT_STAT_CATEGORY", :constant, "VARCHAR2", "DEFAULT_STAT_CATEGORY CONSTANT VARCHAR2(20) := 'OBJECT_STATS';")).should be_true
99
- parser.items.include?(DeclareItem.new("PURGE_ALL", :constant, "TIMESTAMP", "PURGE_ALL CONSTANT TIMESTAMP WITH TIME ZONE :=\r\n TO_TIMESTAMP_TZ('1001-01-0101:00:00-00:00','YYYY-MM-DDHH:MI:SSTZH:TZM');")).should be_true
100
- parser.items.include?(DeclareItem.new("prepare_column_values", :procedure, nil, "procedure prepare_column_values(\r\n srec in out StatRec, charvals chararray);")).should be_true
101
- parser.items.include?(DeclareItem.new("prepare_column_values", :procedure, nil, "procedure prepare_column_values(\r\n srec in out StatRec, datevals datearray);")).should be_true
102
- parser.items.include?(DeclareItem.new("prepare_column_values", :procedure, nil, "procedure prepare_column_values(\r\n srec in out StatRec, numvals numarray);")).should be_true
103
- parser.items.include?(DeclareItem.new("prepare_column_values", :procedure, nil, "procedure prepare_column_values(\r\n srec in out StatRec, fltvals fltarray);")).should be_true
104
- parser.items.include?(DeclareItem.new("prepare_column_values", :procedure, nil, "procedure prepare_column_values(\r\n srec in out StatRec, dblvals dblarray);")).should be_true
105
- parser.items.include?(DeclareItem.new("prepare_column_values", :procedure, nil, "procedure prepare_column_values(\r\n srec in out StatRec, rawvals rawarray);")).should be_true
106
- parser.items.include?(DeclareItem.new("prepare_column_values_nvarchar", :procedure, nil, "procedure prepare_column_values_nvarchar(\r\n srec in out StatRec, nvmin nvarchar2, nvmax nvarchar2);")).should be_true
107
- parser.items.include?(DeclareItem.new("prepare_column_values_rowid", :procedure, nil, "procedure prepare_column_values_rowid(\r\n srec in out StatRec, rwmin rowid, rwmax rowid);")).should be_true
108
- parser.items.include?(DeclareItem.new("set_param", :procedure, nil, "procedure set_param(\r\n pname in varchar2,\r\n pval in varchar2);")).should be_true
109
- parser.items.include?(DeclareItem.new("get_param", :function, nil, "function get_param(\r\n pname in varchar2)\r\n return varchar2;")).should be_true
110
- parser.items.include?(DeclareItem.new("reset_param_defaults", :procedure, nil, "procedure reset_param_defaults;")).should be_true
111
- parser.items.include?(DeclareItem.new("reset_global_pref_defaults", :procedure, nil, "procedure reset_global_pref_defaults;")).should be_true
112
- parser.items.include?(DeclareItem.new("set_global_prefs", :procedure, nil, "procedure set_global_prefs(\r\n pname varchar2,\r\n pvalue varchar2);")).should be_true
113
- parser.items.include?(DeclareItem.new("get_prefs", :function, nil, "function get_prefs(\r\n pname in varchar2,\r\n ownname in varchar2 default null,\r\n tabname in varchar2 default null)\r\n return varchar2;")).should be_true
114
- parser.items.include?(DeclareItem.new("set_table_prefs", :procedure, nil, "procedure set_table_prefs(\r\n ownname varchar2,\r\n tabname varchar2,\r\n pname varchar2,\r\n pvalue varchar2);")).should be_true
115
- parser.items.include?(DeclareItem.new("delete_table_prefs", :procedure, nil, "procedure delete_table_prefs(\r\n ownname varchar2,\r\n tabname varchar2,\r\n pname varchar2);")).should be_true
116
- parser.items.include?(DeclareItem.new("export_table_prefs", :procedure, nil, "procedure export_table_prefs(\r\n ownname varchar2,\r\n tabname varchar2,\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
117
- parser.items.include?(DeclareItem.new("import_table_prefs", :procedure, nil, "procedure import_table_prefs(\r\n ownname varchar2,\r\n tabname varchar2,\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
118
- parser.items.include?(DeclareItem.new("set_schema_prefs", :procedure, nil, "procedure set_schema_prefs(\r\n ownname varchar2,\r\n pname varchar2,\r\n pvalue varchar2);")).should be_true
119
- parser.items.include?(DeclareItem.new("delete_schema_prefs", :procedure, nil, "procedure delete_schema_prefs(\r\n ownname varchar2,\r\n pname varchar2);")).should be_true
120
- parser.items.include?(DeclareItem.new("export_schema_prefs", :procedure, nil, "procedure export_schema_prefs(\r\n ownname varchar2,\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
121
- parser.items.include?(DeclareItem.new("import_schema_prefs", :procedure, nil, "procedure import_schema_prefs(\r\n ownname varchar2,\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
122
- parser.items.include?(DeclareItem.new("set_database_prefs", :procedure, nil, "procedure set_database_prefs(\r\n pname varchar2,\r\n pvalue varchar2,\r\n add_sys boolean default false);")).should be_true
123
- parser.items.include?(DeclareItem.new("delete_database_prefs", :procedure, nil, "procedure delete_database_prefs(\r\n pname varchar2,\r\n add_sys boolean default false);")).should be_true
124
- parser.items.include?(DeclareItem.new("export_database_prefs", :procedure, nil, "procedure export_database_prefs(\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null,\r\n add_sys boolean default false);")).should be_true
125
- parser.items.include?(DeclareItem.new("import_database_prefs", :procedure, nil, "procedure import_database_prefs(\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null,\r\n add_sys boolean default false);")).should be_true
126
- parser.items.include?(DeclareItem.new("to_cascade_type", :function, nil, "function to_cascade_type(cascade varchar2) return boolean;")).should be_true
127
- parser.items.include?(DeclareItem.new("to_estimate_percent_type", :function, nil, "function to_estimate_percent_type(estimate_percent varchar2) return number;")).should be_true
128
- parser.items.include?(DeclareItem.new("to_degree_type", :function, nil, "function to_degree_type(degree varchar2) return number;")).should be_true
129
- parser.items.include?(DeclareItem.new("to_no_invalidate_type", :function, nil, "function to_no_invalidate_type(no_invalidate varchar2) return boolean;")).should be_true
130
- parser.items.include?(DeclareItem.new("to_publish_type", :function, nil, "function to_publish_type(publish varchar2) return boolean;")).should be_true
131
- parser.items.include?(DeclareItem.new("init_package", :procedure, nil, "procedure init_package;")).should be_true
132
- parser.items.include?(DeclareItem.new("publish_pending_stats", :procedure, nil, "procedure publish_pending_stats(\r\n ownname varchar2 default USER,\r\n tabname varchar2,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
133
- parser.items.include?(DeclareItem.new("export_pending_stats", :procedure, nil, "procedure export_pending_stats(\r\n ownname varchar2 default USER,\r\n tabname varchar2,\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default USER);")).should be_true
134
- parser.items.include?(DeclareItem.new("delete_pending_stats", :procedure, nil, "procedure delete_pending_stats(\r\n ownname varchar2 default USER,\r\n tabname varchar2 default null);")).should be_true
135
- parser.items.include?(DeclareItem.new("resume_gather_stats", :procedure, nil, "procedure resume_gather_stats;")).should be_true
136
- parser.items.include?(DeclareItem.new("set_column_stats", :procedure, nil, "procedure set_column_stats(\r\n ownname varchar2, tabname varchar2, colname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n distcnt number default null, density number default null,\r\n nullcnt number default null, srec StatRec default null,\r\n avgclen number default null, flags number default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
137
- parser.items.include?(DeclareItem.new("set_column_stats", :procedure, nil, "procedure set_column_stats(\r\n ownname varchar2, tabname varchar2, colname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n ext_stats raw,\r\n stattypown varchar2 default null,\r\n stattypname varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
138
- parser.items.include?(DeclareItem.new("set_index_stats", :procedure, nil, "procedure set_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n numrows number default null, numlblks number default null,\r\n numdist number default null, avglblk number default null,\r\n avgdblk number default null, clstfct number default null,\r\n indlevel number default null, flags number default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n guessq number default null,\r\n cachedblk number default null,\r\n cachehit number default null,\r\n force boolean default FALSE);")).should be_true
139
- parser.items.include?(DeclareItem.new("set_index_stats", :procedure, nil, "procedure set_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n ext_stats raw,\r\n stattypown varchar2 default null,\r\n stattypname varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
140
- parser.items.include?(DeclareItem.new("set_table_stats", :procedure, nil, "procedure set_table_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null,\r\n statid varchar2 default null,\r\n numrows number default null,\r\n numblks number default null,\r\n avgrlen number default null,\r\n flags number default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n cachedblk number default null,\r\n cachehit number default null,\r\n force boolean default FALSE);")).should be_true
141
- parser.items.include?(DeclareItem.new("convert_raw_value", :procedure, nil, "procedure convert_raw_value(\r\n rawval raw, resval out varchar2);")).should be_true
142
- parser.items.include?(DeclareItem.new("convert_raw_value", :procedure, nil, "procedure convert_raw_value(\r\n rawval raw, resval out date);")).should be_true
143
- parser.items.include?(DeclareItem.new("convert_raw_value", :procedure, nil, "procedure convert_raw_value(\r\n rawval raw, resval out number);")).should be_true
144
- parser.items.include?(DeclareItem.new("convert_raw_value", :procedure, nil, "procedure convert_raw_value(\r\n rawval raw, resval out binary_float);")).should be_true
145
- parser.items.include?(DeclareItem.new("convert_raw_value", :procedure, nil, "procedure convert_raw_value(\r\n rawval raw, resval out binary_double);")).should be_true
146
- parser.items.include?(DeclareItem.new("convert_raw_value_nvarchar", :procedure, nil, "procedure convert_raw_value_nvarchar(\r\n rawval raw, resval out nvarchar2);")).should be_true
147
- parser.items.include?(DeclareItem.new("convert_raw_value_rowid", :procedure, nil, "procedure convert_raw_value_rowid(\r\n rawval raw, resval out rowid);")).should be_true
148
- parser.items.include?(DeclareItem.new("get_column_stats", :procedure, nil, "procedure get_column_stats(\r\n ownname varchar2, tabname varchar2, colname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n distcnt out number, density out number,\r\n nullcnt out number, srec out StatRec,\r\n avgclen out number,\r\n statown varchar2 default null);")).should be_true
149
- parser.items.include?(DeclareItem.new("get_column_stats", :procedure, nil, "procedure get_column_stats(\r\n ownname varchar2, tabname varchar2, colname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n ext_stats out raw,\r\n stattypown out varchar2, stattypname out varchar2,\r\n statown varchar2 default null);")).should be_true
150
- parser.items.include?(DeclareItem.new("get_index_stats", :procedure, nil, "procedure get_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n numrows out number, numlblks out number,\r\n numdist out number, avglblk out number,\r\n avgdblk out number, clstfct out number,\r\n indlevel out number,\r\n statown varchar2 default null,\r\n guessq out number,\r\n cachedblk out number,\r\n cachehit out number);")).should be_true
151
- parser.items.include?(DeclareItem.new("get_index_stats", :procedure, nil, "procedure get_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n numrows out number, numlblks out number,\r\n numdist out number, avglblk out number,\r\n avgdblk out number, clstfct out number,\r\n indlevel out number,\r\n statown varchar2 default null,\r\n guessq out number);")).should be_true
152
- parser.items.include?(DeclareItem.new("get_index_stats", :procedure, nil, "procedure get_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n numrows out number, numlblks out number,\r\n numdist out number, avglblk out number,\r\n avgdblk out number, clstfct out number,\r\n indlevel out number,\r\n statown varchar2 default null);")).should be_true
153
- parser.items.include?(DeclareItem.new("get_index_stats", :procedure, nil, "procedure get_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n ext_stats out raw,\r\n stattypown out varchar2, stattypname out varchar2,\r\n statown varchar2 default null);")).should be_true
154
- parser.items.include?(DeclareItem.new("get_table_stats", :procedure, nil, "procedure get_table_stats(\r\n ownname varchar2, tabname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n numrows out number, numblks out number,\r\n avgrlen out number,\r\n statown varchar2 default null);")).should be_true
155
- parser.items.include?(DeclareItem.new("get_table_stats", :procedure, nil, "procedure get_table_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null,\r\n statid varchar2 default null,\r\n numrows out number,\r\n numblks out number,\r\n avgrlen out number,\r\n statown varchar2 default null,\r\n cachedblk out number,\r\n cachehit out number);")).should be_true
156
- parser.items.include?(DeclareItem.new("delete_column_stats", :procedure, nil, "procedure delete_column_stats(\r\n ownname varchar2, tabname varchar2, colname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n cascade_parts boolean default true,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE,\r\n col_stat_type varchar2 default 'ALL');")).should be_true
157
- parser.items.include?(DeclareItem.new("delete_index_stats", :procedure, nil, "procedure delete_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n cascade_parts boolean default true,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'ALL',\r\n force boolean default FALSE);")).should be_true
158
- parser.items.include?(DeclareItem.new("delete_table_stats", :procedure, nil, "procedure delete_table_stats(\r\n ownname varchar2, tabname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n cascade_parts boolean default true,\r\n cascade_columns boolean default true,\r\n cascade_indexes boolean default true,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'ALL',\r\n force boolean default FALSE);")).should be_true
159
- parser.items.include?(DeclareItem.new("delete_schema_stats", :procedure, nil, "procedure delete_schema_stats(\r\n ownname varchar2,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'ALL',\r\n force boolean default FALSE);")).should be_true
160
- parser.items.include?(DeclareItem.new("delete_database_stats", :procedure, nil, "procedure delete_database_stats(\r\n stattab varchar2 default null, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'ALL',\r\n force boolean default FALSE);")).should be_true
161
- parser.items.include?(DeclareItem.new("create_stat_table", :procedure, nil, "procedure create_stat_table(\r\n ownname varchar2, stattab varchar2,\r\n tblspace varchar2 default null,\r\n global_temporary boolean default false);")).should be_true
162
- parser.items.include?(DeclareItem.new("drop_stat_table", :procedure, nil, "procedure drop_stat_table(\r\n ownname varchar2, stattab varchar2);")).should be_true
163
- parser.items.include?(DeclareItem.new("upgrade_stat_table", :procedure, nil, "procedure upgrade_stat_table(\r\n ownname varchar2, stattab varchar2);")).should be_true
164
- parser.items.include?(DeclareItem.new("export_column_stats", :procedure, nil, "procedure export_column_stats(\r\n ownname varchar2, tabname varchar2, colname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
165
- parser.items.include?(DeclareItem.new("export_index_stats", :procedure, nil, "procedure export_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
166
- parser.items.include?(DeclareItem.new("export_table_stats", :procedure, nil, "procedure export_table_stats(\r\n ownname varchar2, tabname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2, statid varchar2 default null,\r\n cascade boolean default true,\r\n statown varchar2 default null,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY\r\n);")).should be_true
167
- parser.items.include?(DeclareItem.new("export_schema_stats", :procedure, nil, "procedure export_schema_stats(\r\n ownname varchar2,\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY);")).should be_true
168
- parser.items.include?(DeclareItem.new("export_database_stats", :procedure, nil, "procedure export_database_stats(\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY);")).should be_true
169
- parser.items.include?(DeclareItem.new("import_column_stats", :procedure, nil, "procedure import_column_stats(\r\n ownname varchar2, tabname varchar2, colname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
170
- parser.items.include?(DeclareItem.new("import_index_stats", :procedure, nil, "procedure import_index_stats(\r\n ownname varchar2, indname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
171
- parser.items.include?(DeclareItem.new("import_table_stats", :procedure, nil, "procedure import_table_stats(\r\n ownname varchar2, tabname varchar2,\r\n partname varchar2 default null,\r\n stattab varchar2, statid varchar2 default null,\r\n cascade boolean default true,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY);")).should be_true
172
- parser.items.include?(DeclareItem.new("import_schema_stats", :procedure, nil, "procedure import_schema_stats(\r\n ownname varchar2,\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY);")).should be_true
173
- parser.items.include?(DeclareItem.new("import_database_stats", :procedure, nil, "procedure import_database_stats(\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY\r\n );")).should be_true
174
- parser.items.include?(DeclareItem.new("gather_index_stats", :procedure, nil, "procedure gather_index_stats\r\n (ownname varchar2, indname varchar2, partname varchar2 default null,\r\n estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n statown varchar2 default null,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'DATA',\r\n force boolean default FALSE);")).should be_true
175
- parser.items.include?(DeclareItem.new("gather_table_stats", :procedure, nil, "procedure gather_table_stats\r\n (ownname varchar2, tabname varchar2, partname varchar2 default null,\r\n estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n block_sample boolean default FALSE,\r\n method_opt varchar2 default DEFAULT_METHOD_OPT,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n cascade boolean default DEFAULT_CASCADE,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'DATA',\r\n force boolean default FALSE,\r\n context dbms_stats.CContext default null);")).should be_true
176
- parser.items.include?(DeclareItem.new("gather_schema_stats", :procedure, nil, "procedure gather_schema_stats\r\n (ownname varchar2,\r\n estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n block_sample boolean default FALSE,\r\n method_opt varchar2 default DEFAULT_METHOD_OPT,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n cascade boolean default DEFAULT_CASCADE,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n options varchar2 default 'GATHER', objlist out ObjectTab,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n gather_temp boolean default FALSE,\r\n gather_fixed boolean default FALSE,\r\n stattype varchar2 default 'DATA',\r\n force boolean default FALSE,\r\n obj_filter_list ObjectTab default null);")).should be_true
177
- parser.items.include?(DeclareItem.new("gather_schema_stats", :procedure, nil, "procedure gather_schema_stats\r\n (ownname varchar2,\r\n estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n block_sample boolean default FALSE,\r\n method_opt varchar2 default DEFAULT_METHOD_OPT,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n cascade boolean default DEFAULT_CASCADE,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n options varchar2 default 'GATHER', statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n gather_temp boolean default FALSE,\r\n gather_fixed boolean default FALSE,\r\n stattype varchar2 default 'DATA',\r\n force boolean default FALSE,\r\n obj_filter_list ObjectTab default null);")).should be_true
178
- parser.items.include?(DeclareItem.new("gather_database_stats", :procedure, nil, "procedure gather_database_stats\r\n (estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n block_sample boolean default FALSE,\r\n method_opt varchar2 default DEFAULT_METHOD_OPT,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n cascade boolean default DEFAULT_CASCADE,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n options varchar2 default 'GATHER', objlist out ObjectTab,\r\n statown varchar2 default null,\r\n gather_sys boolean default TRUE,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n gather_temp boolean default FALSE,\r\n gather_fixed boolean default FALSE,\r\n stattype varchar2 default 'DATA',\r\n obj_filter_list ObjectTab default null);")).should be_true
179
- parser.items.include?(DeclareItem.new("gather_database_stats", :procedure, nil, "procedure gather_database_stats\r\n (estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n block_sample boolean default FALSE,\r\n method_opt varchar2 default DEFAULT_METHOD_OPT,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n cascade boolean default DEFAULT_CASCADE,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n options varchar2 default 'GATHER', statown varchar2 default null,\r\n gather_sys boolean default TRUE,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n gather_temp boolean default FALSE,\r\n gather_fixed boolean default FALSE,\r\n stattype varchar2 default 'DATA',\r\n obj_filter_list ObjectTab default null);")).should be_true
180
- parser.items.include?(DeclareItem.new("generate_stats", :procedure, nil, "procedure generate_stats\r\n (ownname varchar2, objname varchar2,\r\n organized number default 7,\r\n force boolean default FALSE);")).should be_true
181
- parser.items.include?(DeclareItem.new("flush_database_monitoring_info", :procedure, nil, "procedure flush_database_monitoring_info;")).should be_true
182
- parser.items.include?(DeclareItem.new("alter_schema_tab_monitoring", :procedure, nil, "procedure alter_schema_tab_monitoring\r\n (ownname varchar2 default NULL, monitoring boolean default TRUE);")).should be_true
183
- parser.items.include?(DeclareItem.new("alter_database_tab_monitoring", :procedure, nil, "procedure alter_database_tab_monitoring\r\n (monitoring boolean default TRUE, sysobjs boolean default FALSE);")).should be_true
184
- parser.items.include?(DeclareItem.new("gather_system_stats", :procedure, nil, "procedure gather_system_stats (\r\n gathering_mode varchar2 default 'NOWORKLOAD',\r\n interval integer default 60,\r\n stattab varchar2 default null,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
185
- parser.items.include?(DeclareItem.new("get_system_stats", :procedure, nil, "procedure get_system_stats (\r\n status out varchar2,\r\n dstart out date,\r\n dstop out date,\r\n pname varchar2,\r\n pvalue out number,\r\n stattab varchar2 default null,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
186
- parser.items.include?(DeclareItem.new("set_system_stats", :procedure, nil, "procedure set_system_stats (\r\n pname varchar2,\r\n pvalue number,\r\n stattab varchar2 default null,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
187
- parser.items.include?(DeclareItem.new("delete_system_stats", :procedure, nil, "procedure delete_system_stats (\r\n stattab varchar2 default nulL,\r\n statid varchar2 default nulL,\r\n statown varchar2 default null);")).should be_true
188
- parser.items.include?(DeclareItem.new("import_system_stats", :procedure, nil, "procedure import_system_stats (\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
189
- parser.items.include?(DeclareItem.new("export_system_stats", :procedure, nil, "procedure export_system_stats (\r\n stattab varchar2,\r\n statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
190
- parser.items.include?(DeclareItem.new("gather_fixed_objects_stats", :procedure, nil, "procedure gather_fixed_objects_stats\r\n (stattab varchar2 default null, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')));")).should be_true
191
- parser.items.include?(DeclareItem.new("delete_fixed_objects_stats", :procedure, nil, "procedure delete_fixed_objects_stats(\r\n stattab varchar2 default null, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
192
- parser.items.include?(DeclareItem.new("export_fixed_objects_stats", :procedure, nil, "procedure export_fixed_objects_stats(\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null);")).should be_true
193
- parser.items.include?(DeclareItem.new("import_fixed_objects_stats", :procedure, nil, "procedure import_fixed_objects_stats(\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE);")).should be_true
194
- parser.items.include?(DeclareItem.new("gather_dictionary_stats", :procedure, nil, "procedure gather_dictionary_stats\r\n (comp_id varchar2 default null,\r\n estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n block_sample boolean default FALSE,\r\n method_opt varchar2 default DEFAULT_METHOD_OPT,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n cascade boolean default DEFAULT_CASCADE,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n options varchar2 default 'GATHER AUTO', objlist out ObjectTab,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'DATA',\r\n obj_filter_list ObjectTab default null);")).should be_true
195
- parser.items.include?(DeclareItem.new("gather_dictionary_stats", :procedure, nil, "procedure gather_dictionary_stats\r\n (comp_id varchar2 default null,\r\n estimate_percent number default DEFAULT_ESTIMATE_PERCENT,\r\n block_sample boolean default FALSE,\r\n method_opt varchar2 default DEFAULT_METHOD_OPT,\r\n degree number default to_degree_type(get_param('DEGREE')),\r\n granularity varchar2 default DEFAULT_GRANULARITY,\r\n cascade boolean default DEFAULT_CASCADE,\r\n stattab varchar2 default null, statid varchar2 default null,\r\n options varchar2 default 'GATHER AUTO', statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'DATA',\r\n obj_filter_list ObjectTab default null);")).should be_true
196
- parser.items.include?(DeclareItem.new("delete_dictionary_stats", :procedure, nil, "procedure delete_dictionary_stats(\r\n stattab varchar2 default null, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n stattype varchar2 default 'ALL',\r\n force boolean default FALSE);")).should be_true
197
- parser.items.include?(DeclareItem.new("export_dictionary_stats", :procedure, nil, "procedure export_dictionary_stats(\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY);")).should be_true
198
- parser.items.include?(DeclareItem.new("import_dictionary_stats", :procedure, nil, "procedure import_dictionary_stats(\r\n stattab varchar2, statid varchar2 default null,\r\n statown varchar2 default null,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')),\r\n force boolean default FALSE,\r\n stat_category varchar2 default DEFAULT_STAT_CATEGORY);")).should be_true
199
- parser.items.include?(DeclareItem.new("lock_table_stats", :procedure, nil, "procedure lock_table_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n stattype varchar2 default 'ALL');")).should be_true
200
- parser.items.include?(DeclareItem.new("lock_partition_stats", :procedure, nil, "procedure lock_partition_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n partname varchar2);")).should be_true
201
- parser.items.include?(DeclareItem.new("lock_schema_stats", :procedure, nil, "procedure lock_schema_stats(\r\n ownname varchar2,\r\n stattype varchar2 default 'ALL');")).should be_true
202
- parser.items.include?(DeclareItem.new("unlock_table_stats", :procedure, nil, "procedure unlock_table_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n stattype varchar2 default 'ALL');")).should be_true
203
- parser.items.include?(DeclareItem.new("unlock_partition_stats", :procedure, nil, "procedure unlock_partition_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n partname varchar2);")).should be_true
204
- parser.items.include?(DeclareItem.new("unlock_schema_stats", :procedure, nil, "procedure unlock_schema_stats(\r\n ownname varchar2,\r\n stattype varchar2 default 'ALL');")).should be_true
205
- parser.items.include?(DeclareItem.new("restore_table_stats", :procedure, nil, "procedure restore_table_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n as_of_timestamp timestamp with time zone,\r\n restore_cluster_index boolean default FALSE,\r\n force boolean default FALSE,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')));")).should be_true
206
- parser.items.include?(DeclareItem.new("restore_schema_stats", :procedure, nil, "procedure restore_schema_stats(\r\n ownname varchar2,\r\n as_of_timestamp timestamp with time zone,\r\n force boolean default FALSE,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')));")).should be_true
207
- parser.items.include?(DeclareItem.new("restore_database_stats", :procedure, nil, "procedure restore_database_stats(\r\n as_of_timestamp timestamp with time zone,\r\n force boolean default FALSE,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')));")).should be_true
208
- parser.items.include?(DeclareItem.new("restore_fixed_objects_stats", :procedure, nil, "procedure restore_fixed_objects_stats(\r\n as_of_timestamp timestamp with time zone,\r\n force boolean default FALSE,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')));")).should be_true
209
- parser.items.include?(DeclareItem.new("restore_dictionary_stats", :procedure, nil, "procedure restore_dictionary_stats(\r\n as_of_timestamp timestamp with time zone,\r\n force boolean default FALSE,\r\n no_invalidate boolean default\r\n to_no_invalidate_type(get_param('NO_INVALIDATE')));")).should be_true
210
- parser.items.include?(DeclareItem.new("restore_system_stats", :procedure, nil, "procedure restore_system_stats(\r\n as_of_timestamp timestamp with time zone);")).should be_true
211
- parser.items.include?(DeclareItem.new("purge_stats", :procedure, nil, "procedure purge_stats(\r\n before_timestamp timestamp with time zone);")).should be_true
212
- parser.items.include?(DeclareItem.new("alter_stats_history_retention", :procedure, nil, "procedure alter_stats_history_retention(\r\n retention in number);")).should be_true
213
- parser.items.include?(DeclareItem.new("get_stats_history_retention", :function, nil, "function get_stats_history_retention return number;")).should be_true
214
- parser.items.include?(DeclareItem.new("get_stats_history_availability", :function, nil, "function get_stats_history_availability\r\n return timestamp with time zone;")).should be_true
215
- parser.items.include?(DeclareItem.new("copy_table_stats", :procedure, nil, "procedure copy_table_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n srcpartname varchar2,\r\n dstpartname varchar2,\r\n scale_factor number DEFAULT 1,\r\n flags number DEFAULT null,\r\n force boolean DEFAULT FALSE);")).should be_true
216
- parser.items.include?(DeclareItem.new("diff_table_stats_in_stattab", :function, nil, "function diff_table_stats_in_stattab(\r\n ownname varchar2,\r\n tabname varchar2,\r\n stattab1 varchar2,\r\n stattab2 varchar2 default null,\r\n pctthreshold number default 10,\r\n statid1 varchar2 default null,\r\n statid2 varchar2 default null,\r\n stattab1own varchar2 default null,\r\n stattab2own varchar2 default null)\r\n return DiffRepTab pipelined;")).should be_true
217
- parser.items.include?(DeclareItem.new("diff_table_stats_in_history", :function, nil, "function diff_table_stats_in_history(\r\n ownname varchar2,\r\n tabname varchar2,\r\n time1 timestamp with time zone,\r\n time2 timestamp with time zone default null,\r\n pctthreshold number default 10)\r\n return DiffRepTab pipelined;")).should be_true
218
- parser.items.include?(DeclareItem.new("diff_table_stats_in_pending", :function, nil, "function diff_table_stats_in_pending(\r\n ownname varchar2,\r\n tabname varchar2,\r\n time_stamp timestamp with time zone default null,\r\n pctthreshold number default 10)\r\n return DiffRepTab pipelined;")).should be_true
219
- parser.items.include?(DeclareItem.new("create_extended_stats", :function, nil, "function create_extended_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n extension varchar2)\r\n return varchar2;")).should be_true
220
- parser.items.include?(DeclareItem.new("create_extended_stats", :function, nil, "function create_extended_stats(\r\n ownname varchar2,\r\n tabname varchar2)\r\n return clob;")).should be_true
221
- parser.items.include?(DeclareItem.new("show_extended_stats_name", :function, nil, "function show_extended_stats_name(\r\n ownname varchar2,\r\n tabname varchar2,\r\n extension varchar2)\r\n return varchar2;")).should be_true
222
- parser.items.include?(DeclareItem.new("drop_extended_stats", :procedure, nil, "procedure drop_extended_stats(\r\n ownname varchar2,\r\n tabname varchar2,\r\n extension varchar2);")).should be_true
223
- parser.items.include?(DeclareItem.new("merge_col_usage", :procedure, nil, "procedure merge_col_usage(\r\n dblink varchar2);")).should be_true
224
- parser.items.include?(DeclareItem.new("seed_col_usage", :procedure, nil, "procedure seed_col_usage(\r\n sqlset_name IN VARCHAR2,\r\n owner_name IN VARCHAR2,\r\n time_limit IN POSITIVE DEFAULT NULL);")).should be_true
225
- parser.items.include?(DeclareItem.new("reset_col_usage", :procedure, nil, "procedure reset_col_usage(\r\n ownname varchar2,\r\n tabname varchar2);")).should be_true
226
- parser.items.include?(DeclareItem.new("report_col_usage", :function, nil, "function report_col_usage(\r\n ownname varchar2,\r\n tabname varchar2) return clob;")).should be_true
227
- parser.items.include?(DeclareItem.new("gather_database_stats_job_proc", :procedure, nil, "procedure gather_database_stats_job_proc;")).should be_true
228
- parser.items.include?(DeclareItem.new("cleanup_stats_job_proc", :procedure, nil, "procedure cleanup_stats_job_proc(\r\n ctx number, job_owner varchar2, job_name varchar2,\r\n sesid number, sesser number);")).should be_true
229
- end
230
-
231
- it 'should work with a SYS package spec' do
232
- text = File.open('spec/sql/dbms_crypto.spc', 'rb') { |file| file.read }
233
- parser = Vorax::Parser::Declare.new(text)
234
- DeclareItem.new("HASH_MD4", :constant, "PLS_INTEGER", "HASH_MD4 CONSTANT PLS_INTEGER := 1;")
235
- DeclareItem.new("HASH_MD5", :constant, "PLS_INTEGER", "HASH_MD5 CONSTANT PLS_INTEGER := 2;")
236
- DeclareItem.new("HASH_SH1", :constant, "PLS_INTEGER", "HASH_SH1 CONSTANT PLS_INTEGER := 3;")
237
- DeclareItem.new("HMAC_MD5", :constant, "PLS_INTEGER", "HMAC_MD5 CONSTANT PLS_INTEGER := 1;")
238
- DeclareItem.new("HMAC_SH1", :constant, "PLS_INTEGER", "HMAC_SH1 CONSTANT PLS_INTEGER := 2;")
239
- DeclareItem.new("ENCRYPT_DES", :constant, "PLS_INTEGER", "ENCRYPT_DES CONSTANT PLS_INTEGER := 1;")
240
- DeclareItem.new("ENCRYPT_3DES_2KEY", :constant, "PLS_INTEGER", "ENCRYPT_3DES_2KEY CONSTANT PLS_INTEGER := 2;")
241
- DeclareItem.new("ENCRYPT_3DES", :constant, "PLS_INTEGER", "ENCRYPT_3DES CONSTANT PLS_INTEGER := 3;")
242
- DeclareItem.new("ENCRYPT_AES", :constant, "PLS_INTEGER", "ENCRYPT_AES CONSTANT PLS_INTEGER := 4;")
243
- DeclareItem.new("ENCRYPT_PBE_MD5DES", :constant, "PLS_INTEGER", "ENCRYPT_PBE_MD5DES CONSTANT PLS_INTEGER := 5;")
244
- DeclareItem.new("ENCRYPT_AES128", :constant, "PLS_INTEGER", "ENCRYPT_AES128 CONSTANT PLS_INTEGER := 6;")
245
- DeclareItem.new("ENCRYPT_AES192", :constant, "PLS_INTEGER", "ENCRYPT_AES192 CONSTANT PLS_INTEGER := 7;")
246
- DeclareItem.new("ENCRYPT_AES256", :constant, "PLS_INTEGER", "ENCRYPT_AES256 CONSTANT PLS_INTEGER := 8;")
247
- DeclareItem.new("CHAIN_CBC", :constant, "PLS_INTEGER", "CHAIN_CBC CONSTANT PLS_INTEGER := 256;")
248
- DeclareItem.new("CHAIN_CFB", :constant, "PLS_INTEGER", "CHAIN_CFB CONSTANT PLS_INTEGER := 512;")
249
- DeclareItem.new("CHAIN_ECB", :constant, "PLS_INTEGER", "CHAIN_ECB CONSTANT PLS_INTEGER := 768;")
250
- DeclareItem.new("CHAIN_OFB", :constant, "PLS_INTEGER", "CHAIN_OFB CONSTANT PLS_INTEGER := 1024;")
251
- DeclareItem.new("PAD_PKCS5", :constant, "PLS_INTEGER", "PAD_PKCS5 CONSTANT PLS_INTEGER := 4096;")
252
- DeclareItem.new("PAD_NONE", :constant, "PLS_INTEGER", "PAD_NONE CONSTANT PLS_INTEGER := 8192;")
253
- DeclareItem.new("PAD_ZERO", :constant, "PLS_INTEGER", "PAD_ZERO CONSTANT PLS_INTEGER := 12288;")
254
- DeclareItem.new("PAD_ORCL", :constant, "PLS_INTEGER", "PAD_ORCL CONSTANT PLS_INTEGER := 16384;")
255
- DeclareItem.new("ENCRYPT_RC4", :constant, "PLS_INTEGER", "ENCRYPT_RC4 CONSTANT PLS_INTEGER := 129;")
256
- DeclareItem.new("DES_CBC_PKCS5", :constant, "PLS_INTEGER", "DES_CBC_PKCS5 CONSTANT PLS_INTEGER := ENCRYPT_DES\r\n + CHAIN_CBC\r\n + PAD_PKCS5;")
257
- DeclareItem.new("DES3_CBC_PKCS5", :constant, "PLS_INTEGER", "DES3_CBC_PKCS5 CONSTANT PLS_INTEGER := ENCRYPT_3DES\r\n + CHAIN_CBC\r\n + PAD_PKCS5;")
258
- DeclareItem.new("AES_CBC_PKCS5", :constant, "PLS_INTEGER", "AES_CBC_PKCS5 CONSTANT PLS_INTEGER := ENCRYPT_AES\r\n + CHAIN_CBC\r\n + PAD_PKCS5;")
259
- DeclareItem.new("CipherSuiteInvalid", :exception, "EXCEPTION", "CipherSuiteInvalid EXCEPTION;")
260
- DeclareItem.new("CipherSuiteNull", :exception, "EXCEPTION", "CipherSuiteNull EXCEPTION;")
261
- DeclareItem.new("KeyNull", :exception, "EXCEPTION", "KeyNull EXCEPTION;")
262
- DeclareItem.new("KeyBadSize", :exception, "EXCEPTION", "KeyBadSize EXCEPTION;")
263
- DeclareItem.new("DoubleEncryption", :exception, "EXCEPTION", "DoubleEncryption EXCEPTION;")
264
- DeclareItem.new("Encrypt", :function, nil, "FUNCTION Encrypt (src IN RAW,\r\n typ IN PLS_INTEGER,\r\n key IN RAW,\r\n iv IN RAW DEFAULT NULL)\r\n RETURN RAW;")
265
- DeclareItem.new("Encrypt", :procedure, nil, "PROCEDURE Encrypt (dst IN OUT NOCOPY BLOB,\r\n src IN BLOB,\r\n typ IN PLS_INTEGER,\r\n key IN RAW,\r\n iv IN RAW DEFAULT NULL);")
266
- DeclareItem.new("Encrypt", :procedure, nil, "PROCEDURE Encrypt (dst IN OUT NOCOPY BLOB,\r\n src IN CLOB CHARACTER SET ANY_CS,\r\n typ IN PLS_INTEGER,\r\n key IN RAW,\r\n iv IN RAW DEFAULT NULL);")
267
- DeclareItem.new("Decrypt", :function, nil, "FUNCTION Decrypt (src IN RAW,\r\n typ IN PLS_INTEGER,\r\n key IN RAW,\r\n iv IN RAW DEFAULT NULL)\r\n RETURN RAW;")
268
- DeclareItem.new("Decrypt", :procedure, nil, "PROCEDURE Decrypt (dst IN OUT NOCOPY BLOB,\r\n src IN BLOB,\r\n typ IN PLS_INTEGER,\r\n key IN RAW,\r\n iv IN RAW DEFAULT NULL);")
269
- DeclareItem.new("Decrypt", :procedure, nil, "PROCEDURE Decrypt (dst IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,\r\n src IN BLOB,\r\n typ IN PLS_INTEGER,\r\n key IN RAW,\r\n iv IN RAW DEFAULT NULL);")
270
- DeclareItem.new("Hash", :function, nil, "FUNCTION Hash (src IN RAW,\r\n typ IN PLS_INTEGER)\r\n RETURN RAW DETERMINISTIC;")
271
- DeclareItem.new("Hash", :function, nil, "FUNCTION Hash (src IN BLOB,\r\n typ IN PLS_INTEGER)\r\n RETURN RAW DETERMINISTIC;")
272
- DeclareItem.new("Hash", :function, nil, "FUNCTION Hash (src IN CLOB CHARACTER SET ANY_CS,\r\n typ IN PLS_INTEGER)\r\n RETURN RAW DETERMINISTIC;")
273
- DeclareItem.new("Mac", :function, nil, "FUNCTION Mac (src IN RAW,\r\n typ IN PLS_INTEGER,\r\n key IN RAW)\r\n RETURN RAW;")
274
- DeclareItem.new("Mac", :function, nil, "FUNCTION Mac (src IN BLOB,\r\n typ IN PLS_INTEGER,\r\n key IN RAW)\r\n RETURN RAW;")
275
- DeclareItem.new("Mac", :function, nil, "FUNCTION Mac (src IN CLOB CHARACTER SET ANY_CS,\r\n typ IN PLS_INTEGER,\r\n key IN RAW)\r\n RETURN RAW;")
276
- DeclareItem.new("RandomBytes", :function, nil, "FUNCTION RandomBytes (number_bytes IN PLS_INTEGER)\r\n RETURN RAW;")
277
- DeclareItem.new("RandomNumber", :function, nil, "FUNCTION RandomNumber\r\n RETURN NUMBER;")
278
- DeclareItem.new("RandomInteger", :function, nil, "FUNCTION RandomInteger\r\n RETURN BINARY_INTEGER;")
279
- end
280
-
281
- end