Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.129.217.196
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /srv/modoboa/env/lib64/python3.5/site-packages/django/db/backends/oracle/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /srv/modoboa/env/lib64/python3.5/site-packages/django/db/backends/oracle/compiler.py
from django.db import NotSupportedError
from django.db.models.sql import compiler


class SQLCompiler(compiler.SQLCompiler):
    def as_sql(self, with_limits=True, with_col_aliases=False):
        """
        Create the SQL for this query. Return the SQL string and list of
        parameters. This is overridden from the original Query class to handle
        the restriction in Oracle 12.1 and emulate LIMIT and OFFSET with
        a subquery.

        If 'with_limits' is False, any limit/offset information is not included
        in the query.
        """
        # Whether the query must be constructed using limit/offset.
        do_offset = with_limits and (self.query.high_mark is not None or self.query.low_mark)
        if not do_offset:
            sql, params = super().as_sql(with_limits=False, with_col_aliases=with_col_aliases)
        elif not self.connection.features.supports_select_for_update_with_limit and self.query.select_for_update:
            raise NotSupportedError(
                'LIMIT/OFFSET is not supported with select_for_update on this '
                'database backend.'
            )
        else:
            sql, params = super().as_sql(with_limits=False, with_col_aliases=True)
            # Wrap the base query in an outer SELECT * with boundaries on
            # the "_RN" column. This is the canonical way to emulate LIMIT
            # and OFFSET on Oracle.
            high_where = ''
            if self.query.high_mark is not None:
                high_where = 'WHERE ROWNUM <= %d' % (self.query.high_mark,)

            if self.query.low_mark:
                sql = (
                    'SELECT * FROM (SELECT "_SUB".*, ROWNUM AS "_RN" FROM (%s) '
                    '"_SUB" %s) WHERE "_RN" > %d' % (sql, high_where, self.query.low_mark)
                )
            else:
                # Simplify the query to support subqueries if there's no offset.
                sql = (
                    'SELECT * FROM (SELECT "_SUB".* FROM (%s) "_SUB" %s)' % (sql, high_where)
                )
        return sql, params


class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):
    pass


class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler):
    pass


class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler):
    pass


class SQLAggregateCompiler(compiler.SQLAggregateCompiler, SQLCompiler):
    pass

Anon7 - 2022
AnonSec Team