DBD-Informix
view release on metacpan or search on metacpan
is happening. Both at test time and at run time, you need to ensure
that the Informix shared libraries will be found when you run Perl with
DBD::Informix. On SVR4 and Linux computers, this means adding these
directories to LD_LIBRARY_PATH; on HP-UX, the variable is SHLIB_PATH;
other systems may have other variable names. Note that web servers, in
particular, do not propagate most environment variables unless you tell
them to do so (use SetEnv or PassEnv in Apache). You need to set
INFORMIXSERVER correctly unless you are using version 5.x ESQL/C. You
may need to set other Informix environment variables too. Consult the
Informix documentation and the Notes/environment.variables file.
The documentation available from 'perldoc DBD::Informix::TestHarness'
tells you how to set the DBD_INFORMIX_DATABASE, DBD_INFORMIX_USERNAME,
and DBD_INFORMIX_PASSWORD environment variables for your system. The
parallel environment variables with suffix 2 (DBD_INFORMIX_DATABASE2,
DBD_INFORMIX_USERNAME2, DBD_INFORMIX_PASSWORD2) specify the second test
database completely independently of the first. If the defaults are
OK, you do not have to set any of these six environment variables. The
default database is 'stores'; no username and password are supplied if
none is specified. If you set the username, you must also set the
password to have any effect. Although the testing does as little
damage as possible, it is not a good idea to use the production
database for this. The stores database is a good bet. Note that these
variables have significance only when you run the DBD::Informix tests.
These variables are not used by DBD::Informix itself, only by the code
in DBD::Informix::TestHarness. Ideally, you should set the variables
before you start the build and you should not change them until after
you complete the testing. If you do change them, you should check that
the esqltest program run by 'perl Makefile.PL' still gives your new
environment a clean bill of health.
One step in the setup process tests that you have permissions on the
databases that will be used by the testing. The step compiles and runs
a relatively simple ESQL/C program that opens a few databases, creates
and drops some tables, and exits. If the test fails, you do you do not
get a Makefile so you cannot build DBD::Informix.
Note that if you set the DELIMIDENT environment variable, some tests
will fail, notably t/t56tabinfo.t and t57tables.t.
If your database is IDS 9.x or later then you need:
- either a smart blob space called sbspace,
- or set the environment variable DBD_INFORMIX_SBSPACE to the name of a
smart blob space,
- or set the environment variable DBD_INFORMIX_NO_SBSPACE to 1 to
indicate that smart blob testing should be omitted.
- or let the tests deduce whether the smart blob space is available.
BUILDING DBD::INFORMIX WITH BUNDLES
If you have preconfigured the Perl CPAN module and correctly set up
your Informix environment, you can install DBD::Informix simply
DBD::Informix by simply typing:
perl -MCPAN -e 'install Bundle::DBD::Informix'
This command gets the latest version of DBI (and its prerequisite
modules) and the latest version of DBD::Informix, and compiles, tests,
and install them all completely automatically. Before doing this, you
need to be confident that things will work correctly (or that you've
got good backups of your Perl installation). On the other hand, it is
an extremely convenient method of updating your Perl software.
When you first use the CPAN module, it will ask you many questions,
including the name of the CPAN site from which to download the
material, but the CPAN module saves this information for the next time
and offers you a choice of sites based on continent and
First consider installing the latest CPAN bundle:
perl -MCPAN -e 'install Bundle::CPAN'
BUILDING DBD::Informix
After you install Perl, DBI, and ESQL/C, run:
perl Makefile.PL
The script tries to work out how to build the module. Then run:
make
The make command should run without errors and ideally without warnings
either. If you get warnings, let us know what they are and how they
how they could be fixed generically. If it fails horribly, see below.
Do NOT hand edit the generated Makefile unless you are completely sure
you understand the implications and are willing to make those changes
manually every time the Makefile is regenerated! To make changes,
always try to edit Makefile.PL, which is extensively annotated. Also
refer to should also read the section on ExtUtils::MakeMaker in the 2nd
Edition of 'Programming Perl'.
You should never need to make any changes to the generated Makefile,
nor to Makefile.PL. If you do, *let us know* so that we can try
to make it automatic in a later release.
Then run:
make test
Note that testing DBD::Informix does create some database objects
(tables, views, synonyms, types, etc). The database is called
'dbd_ix_db', and the other object names start with 'dbd_ix_'. Some of
the tables are permanent; most are temporary. The tests are designed
to work whether the tables and database are present when the tests
start or not; that means they get dropped. Do not run the tests if you
have precious tables or databases that begin 'dbd_ix_'! Starting with
DBD::Informix Version 0.61, the cleanup script t/t99clean.t is run at
the end of the testing. It removes the tables, views, synonyms, etc
and so on that DBD::Informix might have created. Running it manually
("test.one.sh t/t99clean.t") also cleans up the database objects
created by testing DBD::Informix. The tests should be 100% clean if
you run the cleanup script, but if you don't run that, the tests can
leave the odd table or stored procedure (or user-defined data types and
so on) in the database.
Additionally, for a really thorough scrutiny of DBD::Informix, you need
to test it with at least three different databases: one created with
MODE ANSI, one created with a transaction log but not MODE ANSI, and
one created without any transaction logs at all:
( run in 3.050 seconds using v1.01-cache-2.11-cpan-df04353d9ac )