AnyEvent-MySQL

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        each successful reconnect.

1.1.6   2015.9.25
        Add 'ReadOnly' option on DB handles by clking (clking@github)

1.1.5   2014.12.17
        Add 'ping' command. Fix a warning on command retry.
        Patched by Dmitriy Shamatrin (justnoxx@github)

1.1.4   2014.12.9
        Fix a bug (client default charset field) on handshake protocol.
        Thanks to nsnake@github for reporting.

1.1.3   2014.5.23
        Remove feature switch (given..when) to if..elsif..else

1.1.2   2014.5.21
        Add document for passing POD test

1.1.0   2014.5.20
        Fix dependency to Devel::StackTrace in Makefile.PL

lib/AnyEvent/MySQL/Imp.pm  view on Meta::CPAN

            take_filler($_[0], 2),
            take_lcb($_[0]),
        ];
    });
}

=head2 recv_response($hd, %opt, $cb->(TYPE, data...))
  RES_OK, $affected_rows, $insert_id, $server_status, $warning_count, $message
  RES_ERROR, $errno, $sqlstate, $message
  RES_RESULT, \@field, \@row
   $field[$i] = [$catalog, $db, $table, $org_table, $name, $org_name, $charsetnr, $length, $type, $flags, $decimals, $default]
   $row[$i] = [$field, $field, $field, ...]
  RES_PREPARE, $stmt_id, \@param, \@column, $warning_count
   $param[$i] = [$catalog, $db, $table, $org_table, $name, $org_name, $charsetnr, $length, $type, $flags, $decimals, $default]
   $column[$i] = [$catalog, $db, $table, $org_table, $name, $org_name, $charsetnr, $length, $type, $flags, $decimals, $default]
 opt:
  prepare (set to truthy to recv prepare_ok)
=cut
sub recv_response {
    my $cb = ref($_[-1]) eq 'CODE' ? pop : sub {};
    my($hd, %opt) = @_;

    if( DEV ) {
        my $cb0 = $cb;
        $cb = sub {

lib/AnyEvent/MySQL/Imp.pm  view on Meta::CPAN

            # CLIENT_SSL               | # Switch to SSL after handshake
            # CLIENT_IGNORE_SIGPIPE    | # IGNORE sigpipes
            CLIENT_TRANSACTIONS      | # Client knows about transactions
            # CLIENT_RESERVED          | # Old flag for 4.1 protocol 
            CLIENT_SECURE_CONNECTION | # New 4.1 authentication
            CLIENT_MULTI_STATEMENTS  | # Enable/disable multi-stmt support
            CLIENT_MULTI_RESULTS     | # Enable/disable multi-results
            0
        ), 4); # client_flags
        put_num($packet, 0x1000000, 4); # max_packet_size
        put_num($packet, $server_lang, 1); # charset_number
        $packet .= "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; # filler
        put_zstr($packet, $username); # username
        if( $password eq '' ) {
            put_lcs($packet, '');
        }
        else {
            my $stage1_hash = sha1($password);
            put_lcs($packet, sha1($scramble_buff.sha1($stage1_hash)) ^ $stage1_hash); # scramble buff
        }
        put_zstr($packet, $database); # database name



( run in 0.243 second using v1.01-cache-2.11-cpan-4d50c553e7e )