<commit_before>## OpenXPKI::Server::DBI::Driver::Oracle
##
## Written by <NAME> 2006 for the OpenXPKI project
## (c) Copyright 2006 by the OpenXPKI project

package OpenXPKI::Server::DBI::Driver::Oracle;

use strict;
use warnings;
use utf8;

use English;

our %TYPE = (
    SERIAL     => 'NUMBER(38) NOT NULL PRIMARY KEY',
    TEXT       => 'CLOB',
    TIMESTAMP  => 'VARCHAR(20)',
    LONGTEXT   => 'CLOB',
    TEXT_KEY   => 'VARCHAR(255)',
    BIGINT     => 'NUMERIC(38)',
    NUMERIC    => 'NUMERIC(38)'
    );

our $DBI_OPTION = {
    RaiseError => 0, 
    AutoCommit => 0,
    LongReadLen => 1_000_000,
};

our $LIMIT = 'SELECT * FROM (__QUERY__) WHERE ROWNUM <= __MAXITEMS__';
our $LIMITSTART = 'SELECT * FROM ( SELECT a.*, ROWNUM rnum FROM ( __QUERY__ ) a WHERE ROWNUM <= __START__+__MAXITEMS__-1 ) WHERE rnum >= __START__';

sub get_dsn
{
    my $self = shift;

    if (! exists $self->{params}->{NAME})
    {
        OpenXPKI::Exception->throw (
            message => 'I18N_OPENXPKI_SERVER__DBI_DRIVER_ORACLE_GET_DSN_NO_DATABASE_NAME');
    }
    
    my $dsn  = 'dbi:Oracle:' . $self->{params}->{NAME};

    return $dsn;
}                 

sub get_new_serial
{
    my $self = shift;
    my $keys = { @_ };<commit_msg>Oracle: start limited queries with ROWNUM=1, not ROWNUM=0 (does not exist)<commit_after>## OpenXPKI::Server::DBI::Driver::Oracle
##
## Written by <NAME> 2006 for the OpenXPKI project
## (c) Copyright 2006 by the OpenXPKI project

package OpenXPKI::Server::DBI::Driver::Oracle;

use strict;
use warnings;
use utf8;

use English;

our %TYPE = (
    SERIAL     => 'NUMBER(38) NOT NULL PRIMARY KEY',
    TEXT       => 'CLOB',
    TIMESTAMP  => 'VARCHAR(20)',
    LONGTEXT   => 'CLOB',
    TEXT_KEY   => 'VARCHAR(255)',
    BIGINT     => 'NUMERIC(38)',
    NUMERIC    => 'NUMERIC(38)'
    );

our $DBI_OPTION = {
    RaiseError => 0, 
    AutoCommit => 0,
    LongReadLen => 1_000_000,
};

our $LIMIT = 'SELECT * FROM (__QUERY__) WHERE ROWNUM <= __MAXITEMS__';
our $LIMITSTART = 'SELECT * FROM ( SELECT a.*, ROWNUM rnum FROM ( __QUERY__ ) a WHERE ROWNUM <= __START__+__MAXITEMS__ ) WHERE rnum >= __START__+1';

sub get_dsn
{
    my $self = shift;

    if (! exists $self->{params}->{NAME})
    {
        OpenXPKI::Exception->throw (
            message => 'I18N_OPENXPKI_SERVER__DBI_DRIVER_ORACLE_GET_DSN_NO_DATABASE_NAME');
    }
    
    my $dsn  = 'dbi:Oracle:' . $self->{params}->{NAME};

    return $dsn;
}                 

sub get_new_serial
{
    my $self = shift;
    my $keys = { @_ };
{'fraction_non_alphanumeric': 0.15085351329892815, 'fraction_numerical': 0.026200873362445413, 'mean_word_length': 3.0127388535031847, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '258281', 'n_tokens_mistral': 1010, 'n_tokens_neox': 956, 'n_words': 218}