function my_watermark_field_schema($field) {
return array(
'columns' => array(
'fid' => array(
'description' => 'The {file_managed}.fid being referenced in this field.',
'type' => 'int',
'not null' => FALSE,
'unsigned' => TRUE,
),
'alt' => array(
'description' => "Alternative image text, for the image's 'alt' attribute.",
'type' => 'varchar',
'length' => 512,
'not null' => FALSE,
),
'title' => array(
'description' => "Image title text, for the image's 'title' attribute.",
'type' => 'varchar',
'length' => 1024,
'not null' => FALSE,
),
'width' => array(
'description' => 'The width of the image in pixels.',
'type' => 'int',
'unsigned' => TRUE,
),
'height' => array(
'description' => 'The height of the image in pixels.',
'type' => 'int',
'unsigned' => TRUE,
),
),
'indexes' => array(
'fid' => array('fid'),
),
'foreign keys' => array(
'fid' => array(
'table' => 'file_managed',
'columns' => array('fid' => 'fid'),
),
),
);
}
$xapi = new XenApi($uri, $login, $password);
$vifs = $xapi->VIF_get_all();
foreach($vifs as $value){
$vif = $xapi->VIF_get_record($value);
if($vif['MAC'] === $mac){
$selfVM = $vif['VM'];
}
}
drop database if exists one_and_two;
create database one_and_two;
use one_and_two;
drop table if exists one;
create table one(
load_id int unsigned not null,
car_in int unsigned not null,
car_out int unsigned not null,
unique key(load_id)
);
drop table if exists two;
create table two(
car_id int unsigned not null,
number int unsigned not null
);
insert into one(load_id,car_in,car_out) values
(1,22,23),
(2,31,44),
(3,5,11),
(4,7,12);
insert into two(car_id,number) values
(100,78),
(100,77),
(101,70),
(101,57),
(102,97),
(102,91),
(103,96),
(103,91);
select t1.load_id, t1.number as number1, t2.number as number2
from(
select o.load_id, t.car_id - o.car_in as number
from one as o, two as t
where t.number = t.car_id - o.car_in
) as t1,
(
select o.load_id, t.car_id - o.car_out as number
from one as o, two as t
where t.number = t.car_id - o.car_out
) as t2
where t1.load_id = t2.load_id
order by t1.load_id;
auth sufficient pam_succeed_if.so user ingroup xapi