~ubuntu-branches/ubuntu/lucid/php5/lucid

« back to all changes in this revision

Viewing changes to ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-03-16 09:09:50 UTC
  • mfrom: (1.1.18 upstream) (0.3.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100316090950-e36m0pzranoixifd
Tags: 5.3.2-1ubuntu1
* Merge from debian unstable: 
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions already in
      universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
  - Dropped debian/patches/libedit_is_editline.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
                        PDO::MYSQL_ATTR_USE_BUFFERED_QUERY              => 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY',
47
47
                        PDO::MYSQL_ATTR_LOCAL_INFILE                                    => 'PDO::MYSQL_ATTR_LOCAL_INFILE',
48
48
                        PDO::MYSQL_ATTR_DIRECT_QUERY                                    => 'PDO::MYSQL_ATTR_DIRECT_QUERY',
 
49
 
 
50
                        PDO::MYSQL_ATTR_INIT_COMMAND                                    => 'PDO::MYSQL_ATTR_INIT_COMMAND',
49
51
                );
50
52
 
51
53
                $defaults = array(
59
61
                        PDO::MYSQL_ATTR_LOCAL_INFILE                                    => false,
60
62
                        /* TODO getAttribute() does not handle it */
61
63
                        PDO::MYSQL_ATTR_DIRECT_QUERY                                    => 1,
 
64
                        PDO::MYSQL_ATTR_INIT_COMMAND                                    => '',
62
65
                );
63
66
 
64
67
                if (NULL !== ($db = @new PDO($dsn, $user, $pass, 'wrong type')))
140
143
                set_option_and_check(21, PDO::MYSQL_ATTR_LOCAL_INFILE, true, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
141
144
                set_option_and_check(22, PDO::MYSQL_ATTR_LOCAL_INFILE, false, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
142
145
 
 
146
                set_option_and_check(23, PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @a=1', 'PDO::MYSQL_ATTR_INIT_COMMAND');
 
147
                set_option_and_check(24, PDO::MYSQL_ATTR_INIT_COMMAND, '', 'PDO::MYSQL_ATTR_INIT_COMMAND');
 
148
                set_option_and_check(25, PDO::MYSQL_ATTR_INIT_COMMAND, 'INSERT INTO nonexistent(invalid) VALUES (1)', 'PDO::MYSQL_ATTR_INIT_COMMAND');
 
149
 
143
150
                set_option_and_check(33, PDO::MYSQL_ATTR_DIRECT_QUERY, 1, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
144
151
                set_option_and_check(34, PDO::MYSQL_ATTR_DIRECT_QUERY, 0, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
145
152
 
151
158
        }
152
159
 
153
160
        print "done!";
 
161
?>
154
162
--EXPECTF--
155
163
[003] [TODO][CHANGEREQUEST] Please, lets not ignore invalid options and bail out!
156
164
[003a] Expecting default value for 'PDO::ATTR_EMULATE_PREPARES' of '1'/integer, getAttribute() reports setting ''/boolean
 
165
[003a] Expecting default value for 'PDO::MYSQL_ATTR_INIT_COMMAND' of ''/string, getAttribute() reports setting ''/boolean
157
166
 
158
167
Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in %s on line %d
159
168
[010] [TODO][CHANGEREQUEST] ATTR_EMULATE_PREPARES should be on
167
176
Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in %s on line %d
168
177
[018] PDO::MYSQL_ATTR_DIRECT_QUERY should be off
169
178
[021] Execting '1'/boolean got ''/boolean' for options 'PDO::MYSQL_ATTR_LOCAL_INFILE'
170
 
done!
 
 
b'\\ No newline at end of file'
 
179
[023] Execting 'SET @a=1'/string got ''/boolean' for options 'PDO::MYSQL_ATTR_INIT_COMMAND'
 
180
[024] SQLSTATE[42000] [1065] Query was empty
 
181
[025] SQLSTATE[42S02] [1146] Table 'test.nonexistent' doesn't exist
 
182
done!