File: mysql.sql

package info (click to toggle)
lua-dbi 0.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 448 kB
  • sloc: ansic: 3,946; sql: 291; makefile: 129
file content (91 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download | duplicates (2)
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
/*

	MySQL test schema.

*/

drop table if exists select_tests;
create table select_tests
	(
		id int not null primary key auto_increment,

		name varchar(255) not null,
		flag boolean not null,

		maths int not null

	);

insert into select_tests
	(
		name,
		flag,
		maths
	)
	values
	(
		'Row 1',
		true,
		12345
	),
	(
		'Row 2',
		false,
		54321
	),
	(
		'Row 3',
		false,
		324671
	);

grant select on select_tests to 'luadbi'@'%';


drop table if exists insert_tests;
create table insert_tests
	(
		id int not null primary key auto_increment,
		val varchar(255) null
	);

grant insert, select on insert_tests to 'luadbi'@'%';

drop table if exists update_tests;
create table update_tests
	(
		id int not null primary key auto_increment,
		name varchar(255) not null,
		last_update int not null,
		flag bool not null
	);

insert into update_tests
	(
		name,
		last_update,
		flag
	)
	values
	(
		'Row 1',
		UNIX_TIMESTAMP(NOW()),
		1
	),
	(
		'Row 2',
		UNIX_TIMESTAMP(NOW()),
		1
	),
	(
		'Row 3',
		UNIX_TIMESTAMP(NOW()),
		0
	),
	(
		'Row 4',
		UNIX_TIMESTAMP(NOW()),
		1
	);

grant select, update on update_tests to 'luadbi'@'%';