1
CREATE TABLE t1 (a int primary key, b blob);
2
insert into t1 values (1, "Hello World");
3
insert into t1 values (2, "Hello PBMS");
4
insert into t1 values (3, "Hello BLOB World");
5
SELECT COUNT(*) FROM t1;
8
select a, Table_name, Blob_size from pbms_reference ref, t1 where ref.Blob_url = t1.b order by a;
13
select a, MD5_Checksum from pbms_repository rep, pbms_reference ref, t1 where t1.b = ref.Blob_url and ref.Repository_id = rep.Repository_id and ref.Repo_blob_offset = rep.Repo_blob_offset order by a;
15
1 B10A8DB164E0754105B7A99BE72E3FE5
16
2 90D9BF084B48FBC92710E6807B8875B0
17
3 6B230DE148EE7EA4A4454090784119E6
18
CREATE Temporary TABLE my_pbms_blob_ids (id int, offset int, url varchar(120));
19
insert into my_pbms_blob_ids (select Repository_id, Repo_blob_offset, Blob_url from pbms_reference);
20
insert into pbms_metadata (select id, offset, "Name", "Test1" from my_pbms_blob_ids ref, t1 where t1.a = 1 and ref.url = t1.b);
21
insert into pbms_metadata (select id, offset, "Name", "Test2" from my_pbms_blob_ids ref, t1 where t1.a = 2 and ref.url = t1.b);
22
insert into pbms_metadata (select id, offset, "Name", "Test3" from my_pbms_blob_ids ref, t1 where t1.a = 3 and ref.url = t1.b);
23
select a, name, value from pbms_metadata meta, pbms_reference ref, t1 where t1.b = ref.Blob_url and ref.Repository_id = meta.Repository_id and ref.Repo_blob_offset = meta.Repo_blob_offset order by a;
28
delete from my_pbms_blob_ids;
29
insert into my_pbms_blob_ids (select Repository_id, Repo_blob_offset, Blob_url from pbms_reference);
30
insert into pbms_metadata (select id, offset, "Name2", "Test2.2" from my_pbms_blob_ids ref, t1 where t1.a = 2 and ref.url = t1.b);
31
select a, name, value from pbms_metadata meta, pbms_reference ref, t1 where t1.b = ref.Blob_url and ref.Repository_id = meta.Repository_id and ref.Repo_blob_offset = meta.Repo_blob_offset order by a, name;
37
drop Temporary table my_pbms_blob_ids;
39
create table autoincbug (id int not null primary key auto_increment, test varchar(10));
40
alter table autoincbug auto_increment = 1000;
41
insert into autoincbug values (null, 'hej');
42
alter table autoincbug auto_increment = 32727;
43
drop table autoincbug;