File: gh2127-indentifier-max-length.test.lua

package info (click to toggle)
tarantool 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 85,364 kB
  • sloc: ansic: 513,760; cpp: 69,489; sh: 25,650; python: 19,190; perl: 14,973; makefile: 4,173; yacc: 1,329; sql: 1,074; pascal: 620; ruby: 190; awk: 18; lisp: 7
file content (99 lines) | stat: -rwxr-xr-x 1,788 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env tarantool
test = require("sqltester")

test:plan(4)

local tt = {}
local table_word = "АААААААААА"

-- Create 30kb table name
for i=1,300 do
	table.insert(tt, table_word)
end

local table_name = table.concat(tt)

-- Execute CREATE TABLE statement with 30kb table identifier
test:do_execsql_test(
	"identifier-1.1",
	"CREATE TABLE " .. table_name .. "(a INT PRIMARY KEY);"
	, {
	    -- <identifier-1.1>

	    -- <identifier-1.1>
	})

local vt = {}
local view_word = "BBBBBBBBBB"

-- Create 30kb view name
for i=1, 300 do
	table.insert(vt, view_word)
end

local view_name = table.concat(vt)

test:do_execsql_test(
	"identifier-1.2",
	"CREATE VIEW " .. view_name .. " AS SELECT 1; "
	, {
	    -- <identifier-1.2>
	    -- <identifier-1.2>
	})

local it = {}
local index_word = "ЕЕЕЕЕЕЕЕЕЕ"

-- Create 30kb index name
for i=1, 300 do
	table.insert(it, index_word)
end

local index_name = table.concat(it)

local field_table = {}
local field_word = 'ДДДДДДДДД'

-- Create 30kb field name
for i=1, 300 do
	table.insert(field_table, field_word)
end

local field_name = table.concat(field_table)
local create_table = "CREATE TABLE t1(" .. field_name .. " INT PRIMARY KEY);"

test:execsql(create_table)
test:do_execsql_test(
	"identifier-1.3",
	"CREATE INDEX " .. index_name .. " ON t1(" .. field_name .. ");"
	, {
	   -- <identifier-1.3>
	   --
	})


local trig_table = {}
local trigger_word = "ССССССССС"

for i=1, 300 do
	table.insert(trig_table, trigger_word)
end

local trigger_name = table.concat(trig_table)

test:do_execsql_test(
	"identifier-1.4",
	"CREATE TRIGGER " .. trigger_name ..
	[[
	BEFORE UPDATE ON t1
	FOR EACH ROW
    BEGIN
		SELECT 1;
	END;
	]]
	, {
	    -- <identifier-1.4>
	    -- <identifier-1.5>
	})

test:finish_test()