mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-12-24 06:49:29 -05:00
handle 'IF NOT EXISTS' differently in OCI
This commit is contained in:
parent
585d5db983
commit
c725b4f0fe
@ -792,10 +792,24 @@ class Database extends AbstractData
|
|||||||
"vizhash $dataType, " .
|
"vizhash $dataType, " .
|
||||||
"postdate INT$after_key )"
|
"postdate INT$after_key )"
|
||||||
);
|
);
|
||||||
self::$_db->exec(
|
if (self::$_type === 'oci') {
|
||||||
'CREATE INDEX IF NOT EXISTS comment_parent ON ' .
|
self::$_db->exec(
|
||||||
self::_sanitizeIdentifier('comment') . '(pasteid)'
|
'declare
|
||||||
);
|
already_exists exception;
|
||||||
|
columns_indexed exception;
|
||||||
|
pragma exception_init( already_exists, -955 );
|
||||||
|
pragma exception_init(columns_indexed, -1408);
|
||||||
|
begin
|
||||||
|
execute immediate \'create index comment_parent on ' . self::_sanitizeIdentifier('comment') . ' (pasteid)\';
|
||||||
|
exception
|
||||||
|
end'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
self::$_db->exec(
|
||||||
|
'CREATE INDEX IF NOT EXISTS comment_parent ON ' .
|
||||||
|
self::_sanitizeIdentifier('comment') . '(pasteid)'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user