ok....well it seems that the patch works.  relevant bits as follows:

output of the nchar test:

bash-2.05$ perl t/21nchar.t
 Database and client versions and character sets:
Database 9.2.0.5.0 CHAR set is UTF8 (Unicode), NCHAR set is UTF8 (Unicode)
Client 9.2.0.6 NLS_LANG is 'AMERICAN_AMERICA.UTF8', NLS_NCHAR is '<unset>'


when you run the select statement with trace(5), the relevant table column
where bound parameter is compared to looks like:

 col 49: dbtype 1, scale 0, prec 120, nullok 0, name GAME_ID
          : dbsize 30, char_used 0, char_size 30, csid 871, csform 1,
disize 120
fbh 49: 'GAME_ID'   NO null , otype   1->  5, dbsize 30/121, p120.s0


run the test script, no patch, with utf8 scalar as bind param and
ora_csform not set on bind param:

    -> bind_param for DBD::Oracle::st (DBI::st=HASH(0x31c44)~0x31cd4
':game_id' "asfasdf" HASH(0x31c2c))
       bind :game_id <== "asfasdf" (type 0, attribs: HASH(0x31c2c))
       rebinding :game_id (is-utf8, ftype 1, csid 0, csform 0, inout 0)
       bind :game_id <== "asfasdf" (size 7/8/0, ptype 4, otype 1)
       bind :game_id <== 'asfasdf' (size 7/7, otype 1, indp 0, at_exec 1)
       bind :game_id <== "asfasdf" (in, is-utf8, csid 871->0->871, ftype
1, csform 0->2, maxlen 7, maxdata_size 0)
    <- bind_param= 1 at ./testdb2.pl line 36

run the test script, no patch, with utf8 scalar as bind param and
ora_csform set to SQLCS_IMPLICIT :

    -> bind_param for DBD::Oracle::st (DBI::st=HASH(0x324bc)~0x3254c
':game_id' "asfasdf" HASH(0x324a4))
       bind :game_id <== "asfasdf" (type 0, attribs: HASH(0x324a4))
       rebinding :game_id (is-utf8, ftype 1, csid 0, csform 1, inout 0)
       bind :game_id <== "asfasdf" (size 7/8/0, ptype 4, otype 1)
       bind :game_id <== 'asfasdf' (size 7/7, otype 1, indp 0, at_exec 1)
       bind :game_id <== "asfasdf" (in, is-utf8, csid 871->0->871, ftype
1, csform 1->1, maxlen 7, maxdata_size 0)
    <- bind_param= 1 at ./testdb2.pl line 36

    (script hangs due to not-yet-understood csform mismatch issue)

now compile with the patch.  re-run the test script, without the
ora_csform set to SQLCS_IMPLICIT:

    -> bind_param for DBD::Oracle::st (DBI::st=HASH(0x315c0)~0x3173c
':game_id' "asfasdf" HASH(0x315a8))
       bind :game_id <== "asfasdf" (type 0, attribs: HASH(0x315a8))
       rebinding :game_id (is-utf8, ftype 1, csid 0, csform 0, inout 0)
       bind :game_id <== "asfasdf" (size 7/8/0, ptype 4, otype 1)
       bind :game_id <== 'asfasdf' (size 7/7, otype 1, indp 0, at_exec 1)
       bind :game_id <== "asfasdf" (in, is-utf8, csid 871->0->871, ftype
1, csform 0->1, maxlen 7, maxdata_size 0)
    <- bind_param= 1 at ./testdb2.pl line 39

and then the script works.

as far as a test case, so far my two test criterion are a. this specific
table on this specific database which hangs for unclear reasons, so thats
not a good candidate and b. looking in this trace log and seeing "csform
0->1".

so whats a good way to verify the OCI_ATTR_CHARSET_FORM of a bind variable
?  does it affect the data that gets inserted into a column ?


- mike




Reply via email to