def order_by_label_with_expression(self): return fails_if([ ('firebird', None, None, "kinterbasdb doesn't send full type information"), ('postgresql', None, None, 'only simple labels allowed'), ('sybase', None, None, 'only simple labels allowed'), ('mssql', None, None, 'only simple labels allowed') ])
def empty_strings_varchar(self): """ target database can persist/return an empty string with a varchar. """ return fails_if(["oracle"], 'oracle converts empty strings to a blank space')
def intersect(self): """Target database must support INTERSECT or equivalent.""" return fails_if([ "firebird", self._mysql_not_mariadb_103, "sybase", ], 'no support for INTERSECT')
def parens_in_union_contained_select(self): """Target database must support parenthesized SELECT in UNION. E.g. (SELECT ...) UNION (SELECT ..) """ return fails_if('sqlite')
def expressions_against_unbounded_text(self): """target database supports use of an unbounded textual field in a WHERE clause.""" return fails_if( ["oracle"], "ORA-00932: inconsistent datatypes: expected - got CLOB", )
def precision_numerics_many_significant_digits(self): """target backend supports values with many digits on both sides, such as 319438950232418390.273596, 87673.594069654243 """ return exclusions.fails_if(lambda: True, "Throws error SQL0604N, regarding Decimal(38, 12)" )
def precision_numerics_enotation_large(self): """target backend supports Decimal() objects using E notation to represent very large values.""" return fails_if( ("sybase+pyodbc", None, None, "Don't know how do get these values through FreeTDS + Sybase"), ("firebird", None, None, "Precision must be from 1 to 18"), )
def two_phase_recovery(self): return self.two_phase_transactions + ( exclusions.fails_if( lambda config: config.db.name == 'mysql' and ( config.db.dialect._is_mariadb or config.db.dialect.server_version_info < (5, 7) ) ) )
def precision_generic_float_type(self): """target backend will return native floating point numbers with at least seven decimal places when using the generic Float type.""" return fails_if([ ('mysql', None, None, 'mysql FLOAT type only returns 4 decimals'), ('firebird', None, None, "firebird FLOAT type isn't high precision"), ])
def order_by_col_from_union(self): """target database supports ordering by a column from a SELECT inside of a UNION E.g. (SELECT id, ...) UNION (SELECT id, ...) ORDER BY id Fails on SQL Server """ return fails_if('mssql')
def parens_in_union_contained_select_w_limit_offset(self): """Target database must support parenthesized SELECT in UNION when LIMIT/OFFSET is specifically present. E.g. (SELECT ...) UNION (SELECT ..) This is known to fail on SQLite. """ return fails_if('sqlite')
def floats_to_four_decimals(self): return fails_if([ ("mysql+oursql", None, None, "Floating point error"), ("firebird", None, None, "Firebird still has FP inaccuracy even " "with only four decimal places"), ('mssql+pyodbc', None, None, 'mssql+pyodbc has FP inaccuracy even with ' 'only four decimal places ' ) ])
def precision_numerics_many_significant_digits(self): """target backend supports values with many digits on both sides, such as 319438950232418390.273596, 87673.594069654243 """ return fails_if( [('sqlite', None, None, 'TODO'), ("firebird", None, None, "Precision must be from 1 to 18"), ("sybase+pysybase", None, None, "TODO"), ('mssql+pymssql', None, None, 'FIXME: improve pymssql dec handling')] )
def precision_numerics_retains_significant_digits(self): """A precision numeric type will return empty significant digits, i.e. a value such as 10.000 will come back in Decimal form with the .000 maintained.""" return fails_if( [ ("oracle", None, None, "driver doesn't do this automatically"), ("firebird", None, None, "database and/or driver truncates decimal places.") ] )
def parens_in_union_contained_select_wo_limit_offset(self): """Target database must support parenthesized SELECT in UNION when OFFSET/LIMIT is specifically not present. E.g. (SELECT ... LIMIT ..) UNION (SELECT .. OFFSET ..) This is known to fail on SQLite. It also fails on Oracle because without LIMIT/OFFSET, there is currently no step that creates an additional subquery. """ return fails_if(['sqlite', 'oracle'])
def update_where_target_in_subquery(self): """Target must support UPDATE where the same table is present in a subquery in the WHERE clause. This is an ANSI-standard syntax that apparently MySQL can't handle, such as: UPDATE documents SET flag=1 WHERE documents.title IN (SELECT max(documents.title) AS title FROM documents GROUP BY documents.user_id ) """ return fails_if("mysql", 'MySQL error 1093 "Cant specify target table ' 'for update in FROM clause"')
def order_by_label_with_expression(self): return fails_if( [ ( "firebird", None, None, "kinterbasdb doesn't send full type information", ), ("postgresql", None, None, "only simple labels allowed"), ("sybase", None, None, "only simple labels allowed"), ("mssql", None, None, "only simple labels allowed"), ] )
def precision_numerics_retains_significant_digits(self): """A precision numeric type will return empty significant digits, i.e. a value such as 10.000 will come back in Decimal form with the .000 maintained.""" return fails_if( [ ('oracle', None, None, "this may be a bug due to the difficulty in handling " "oracle precision numerics"), ("firebird", None, None, "database and/or driver truncates decimal places.") ] )
def precision_generic_float_type(self): """target backend will return native floating point numbers with at least seven decimal places when using the generic Float type.""" return fails_if([ ( "mysql", None, None, "mysql FLOAT type only returns 4 decimals", ), ( "firebird", None, None, "firebird FLOAT type isn't high precision", ), ])
def floats_to_four_decimals(self): return fails_if([ ("mysql+oursql", None, None, "Floating point error"), ("firebird", None, None, "Firebird still has FP inaccuracy even " "with only four decimal places"), ('mssql+pyodbc', None, None, 'mssql+pyodbc has FP inaccuracy even with ' 'only four decimal places '), ('mssql+pymssql', None, None, 'mssql+pymssql has FP inaccuracy even with ' 'only four decimal places '), ('postgresql+pg8000', None, None, 'postgresql+pg8000 has FP inaccuracy even with ' 'only four decimal places '), ('postgresql+psycopg2cffi', None, None, 'postgresql+psycopg2cffi has FP inaccuracy even with ' 'only four decimal places ') ])
def precision_numerics_many_significant_digits(self): """target backend supports values with many digits on both sides, such as 319438950232418390.273596, 87673.594069654243 """ def broken_cx_oracle(config): return against(config, 'oracle+cx_oracle') and \ config.db.dialect.cx_oracle_ver <= (6, 0, 2) and \ config.db.dialect.cx_oracle_ver > (6, ) return fails_if( [ ('sqlite', None, None, 'TODO'), ("firebird", None, None, "Precision must be from 1 to 18"), ("sybase+pysybase", None, None, "TODO"), ] )
def update_where_target_in_subquery(self): """Target must support UPDATE (or DELETE) where the same table is present in a subquery in the WHERE clause. This is an ANSI-standard syntax that apparently MySQL can't handle, such as:: UPDATE documents SET flag=1 WHERE documents.title IN (SELECT max(documents.title) AS title FROM documents GROUP BY documents.user_id ) """ return fails_if( self._mysql_not_mariadb_103, 'MySQL error 1093 "Cant specify target table ' 'for update in FROM clause", resolved by MariaDB 10.3', )
def floats_to_four_decimals(self): return fails_if( [ ("mysql+oursql", None, None, "Floating point error"), ( "firebird", None, None, "Firebird still has FP inaccuracy even " "with only four decimal places", ), ( "mssql+pyodbc", None, None, "mssql+pyodbc has FP inaccuracy even with " "only four decimal places ", ), ( "mssql+pymssql", None, None, "mssql+pymssql has FP inaccuracy even with " "only four decimal places ", ), ( "postgresql+pg8000", None, None, "postgresql+pg8000 has FP inaccuracy even with " "only four decimal places ", ), ( "postgresql+psycopg2cffi", None, None, "postgresql+psycopg2cffi has FP inaccuracy even with " "only four decimal places ", ), ] )
def json_array_indexes(self): return self.json_type + fails_if("+pg8000")
def sane_multi_rowcount(self): return fails_if( lambda config: not config.db.dialect.supports_sane_multi_rowcount, "driver %(driver)s %(doesnt_support)s 'sane' multi row count")
def two_phase_recovery(self): return self.two_phase_transactions + ( exclusions.fails_if(lambda config: config.db.name == 'mysql' and (config.db.dialect._is_mariadb or config.db. dialect.server_version_info < (5, 7))))
def empty_strings_varchar(self): """target database can persist/return an empty string with a varchar.""" return fails_if(["oracle"], 'oracle converts empty strings to a blank space')
def offset(self): """Target database must support some method of adding OFFSET or equivalent to a result set.""" return fails_if(["sybase"], "no support for OFFSET or equivalent")
def precision_numerics_enotation_small(self): """target backend supports Decimal() objects using E notation to represent very small values.""" return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
def empty_strings_text(self): """target database can persist/return an empty string with an unbounded text.""" return fails_if(["oracle"], "oracle converts empty strings to a blank space")
def precision_numerics_many_significant_digits(self): """target backend supports values with many digits on both sides, such as 319438950232418390.273596, 87673.594069654243 """ return exclusions.fails_if( lambda: True, "Throws error SQL0604N, regarding Decimal(38, 12)")
def intersect(self): """Target database must support INTERSECT or equivalent.""" return fails_if(["firebird", "mysql", "sybase", "informix"], 'no support for INTERSECT')
def except_(self): """Target database must support EXCEPT or equivalent (i.e. MINUS).""" return fails_if([ "firebird", "mysql", "sybase", ], 'no support for EXCEPT')
def except_(self): """Target database must support EXCEPT or equivalent (i.e. MINUS).""" return fails_if(["firebird", "mysql", "sybase", "informix"], 'no support for EXCEPT')
def floats_to_four_decimals(self): return fails_if("mysql+oursql", "Floating point error")
def precision_numerics_general(self): """target backend has general support for moderately high-precision numerics.""" return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
def except_(self): """Target database must support EXCEPT or equivalent (i.e. MINUS).""" return fails_if( ["firebird", self._mysql_not_mariadb_103, "sybase"], "no support for EXCEPT", )
def sql_expression_limit_offset(self): return (fails_if( ["mysql", "mssql"], "Target backend can't accommodate full expressions in " "OFFSET or LIMIT", ) + self.offset)
def intersect(self): """Target database must support INTERSECT or equivalent.""" return fails_if([ "firebird", "mysql", "sybase", "informix" ], 'no support for INTERSECT')
def sane_multi_rowcount(self): return fails_if( lambda config: not config.db.dialect.supports_sane_multi_rowcount, "driver %(driver)s %(doesnt_support)s 'sane' multi row count" )
def sane_multi_rowcount(self): """Insert DocString Here.""" return exclusions.fails_if( lambda config: not config.db.dialect.supports_sane_multi_rowcount, "driver %(driver)s %(doesnt_support)s 'sane' multi row count", )
def offset(self): """Target database must support some method of adding OFFSET or equivalent to a result set.""" return fails_if([ "sybase" ], 'no support for OFFSET or equivalent')
def non_native_boolean(self): """test will fail if native boolean is provided""" return exclusions.fails_if( exclusions.LambdaPredicate( lambda config: config.db.dialect.supports_native_boolean))
def precision_generic_float_type(self): """target backend will return native floating point numbers with at least seven decimal places when using the generic Float type.""" return fails_if('mysql', 'mysql FLOAT type only returns 4 decimals')
def sql_expression_limit_offset(self): return (fails_if( ["mysql"], "MySQL can't accommodate full expressions in OFFSET or LIMIT", ) + self.offset)