NAME
DBIO::Sybase::Test::Conformance - Answers the shared conformance case table for the Sybase ASE driver
VERSION
version 0.900007
SYNOPSIS
use DBIO::Sybase::Test::Conformance;
DBIO::Sybase::Test::Conformance->run('DDL');
done_testing;
DESCRIPTION
The driver's half of the shared case table of DBIO::Test::Conformance (core ADR 0060). Core owns the cases and the runner; this class says how to reach an ASE server, how to install a declaration into it through $schema->deploy and how to upgrade it through DBIO::Sybase::Deploy, and how to read a fact back through DBIO::Sybase::Introspect.
The server. DBIO_TEST_SYBASE_DSN, _USER and _PASS (DBD::Sybase; TDSVER=5.0 under FreeTDS). Without them, or without the DBD, only the declarations are checked. The login needs CREATE DATABASE, and the server room for it (Msg 1810 otherwise, see README.md, "Live tests"): "diff" in DBIO::Sybase::Deploy builds its target in a throwaway database, and so does every case here.
The namespace of a case is a database of its own, dbio_cf_<pid>_<n>. ASE has no schemas to bind a session to -- a table lands in the owner dbo of the database the connection is in -- and the diff compares the whole database, so one case's tables would come back as DROP in the next. A database per case keeps dbo empty. "conformance_connect" only picks the name -- the connection has to name it -- and builds the lazy connection; "conformance_namespace" creates the database and hands back a token { name => ..., created => 1 }, and "conformance_cleanup" drops exactly what that token names. The runner calls the cleanup always, also when the namespace threw: a name that is taken already makes the namespace throw without a token, and the database that was there before the case is never dropped.
The class names no storage class and never decides the driver: the schema component Sybase declares it, the DSN names the access path.
METHODS
conformance_live_available
True when a server is configured (see "DESCRIPTION") and DBD::Sybase loads.
conformance_connect
Picks the name of the case's database, loads the Sybase schema component into the case's schema class and connects to that database.
conformance_quote_ident
The name as DBIO::Sybase::Quote writes it into DDL. The runner asks before the case's database exists, and the default (the quote character of the SQL maker) would connect the lazy storage for the answer.
conformance_namespace
Creates the database of the case, on an admin connection of its own, and returns the token { name, created } for "conformance_cleanup". A database of that name that exists already makes it throw, touching nothing and returning no token. The database gets abort tran on log full (a full log is refused instead of suspending the session, as for the throwaway database of DBIO::Sybase::Deploy) and select into/bulkcopy/pllsort (the data-copying ALTER TABLE of an upgrade needs it).
conformance_install
Installs the declaration with $schema->deploy.
conformance_upgrade
Connects the to declaration to the database of the case and runs "upgrade" in DBIO::Sybase::Deploy over it with allow_destructive => 1 (the guard itself is the deploy cases, "conformance_deploy"). The database is the case's own, so the connection is made anew (a handle cannot be shared: the temporary database of the diff is reached through a connection derived from this one's DSN).
conformance_deploy
Same connecting as "conformance_upgrade", but returns the deploy object over the connected target schema, DBIO::Sybase::Deploy->new(schema => $to), for the deploy cases of the Diff list (ADR 0080): apply and upgrade are those of DBIO::Deploy::Base, dry_run executes nothing, and a diff with a drop or a lossy change needs allow_destructive.
conformance_cleanup
Disconnects, and drops the database the token names (the tables and keys go with it), repeating the drop on Msg 3702 as DBIO::Sybase::Deploy does. Without a token nothing is dropped. Also after a failed case. The throwaway databases of a diff are the diff's own to drop; a _dbio_tmp_* database left by a crash is found by name.
conformance_diff_is_empty
True when "diff" in DBIO::Sybase::Deploy of the installed database against the same declaration has no changes.
conformance_answered_through
{ DDL => 2, Diff => 4, Bind => 1 }: the answers are written against version 2 of the DDL case table, version 4 of the Diff table and version 1 of the Bind table ("table_version" in DBIO::Test::Conformance).
Version 3 of the Diff list replaces diff-column-dropped-with-index by diff-indexed-column-dropped; it runs. Version 4 adds the deploy cases, answered through "conformance_deploy".
conformance_refusals
DDL list: ddl-enum-value-apostrophe, ddl-type-size-bit and ddl-base-types-roundtrip (a nullable bit is Msg 2718) are refused by DBIO::Sybase::DDL before the server is asked, ddl-fk-actions by the referential-action check, ddl-qualified-source-name by DBIO::Sybase::Quote (a dot is owner.name) -- all server; ddl-default-digit-string is a deviation (a char(n) is blank-padded). ddl-type-size-char is answered right: the storage sets string_rtruncation on on every connection, so a string too long for its column is Msg 9502 and not cut without a word.
Diff list: diff-table-added-complete (a CASCADE), diff-column-added-not-null-populated (ASE wants a default on a NOT NULL add, also on an empty table), diff-column-added-expression-default (Msg 13918: no expression default on a NOT NULL add) and diff-not-null-over-nulls ("apply" in DBIO::Sybase::Deploy looks for NULLs first, Msg 515) are server refusals; diff-default-removed is answered right (the comparator reports the dropped default, DBIO::Sybase::Diff::Column writes REPLACE col DEFAULT NULL).
Bind list: bind-empty-string is a deviation (ASE keeps '' as one space in a varchar column and converts it to 0 for an integer one). Over FreeTDS (asked of a connection, _freetds) four cases are server refusals, bind-long-string, bind-binary, bind-lob-empty-and-large and bind-lob-row-operations, and so is bind-non-ascii (its column is a TEXT): FreeTDS cannot write the content of a TEXT or IMAGE column (ct_data_info), and DBIO::Sybase::Storage::ASE::LOBWriter refuses before it sends anything. A character beyond ASCII for a varchar or univarchar column is refused over FreeTDS by _refuse_non_ascii_binds (t/114, t/115): the client library reports the failed conversion after the row was written, with a blank in it. Nothing is declared over the Open Client libraries, where nothing was measured. bind-digit-string-leading-zero, bind-integer-string-in-expression, bind-question-mark-in-literal and bind-numeric-exact are answered right. ddl-qualified-source-name is refused always: the DDL never writes owner.table (a dot is refused by DBIO::Sybase::Quote), whether or not the owner exists.
Of the two halves of U13 (Diff table version 2), diff-constraint-changed runs and diff-fk-action-changed is refused like every ON DELETE CASCADE, naming parent_id.
conformance_fact
Reads one fact through DBIO::Sybase::Introspect (owner dbo of the case's database); the vocabulary is the one of "Facts" in DBIO::Test::Conformance.
SEE ALSO
DBIO::Test::Conformance - the runner and the contract of the seams
DBIO::Test::Conformance::Cases::DDL - the DDL case list
DBIO::Sybase::Deploy - install and diff, as the cases reach them
DBIO::Sybase::Introspect - what the facts are read through
AUTHOR
DBIO & DBIx::Class Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.