Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

That is a lot of data sources. Perhaps someone ca see a flaw in the XS code that DBD::ODBC uses:

void data_sources(drh, attr = NULL) SV* drh; SV* attr; PROTOTYPE: $;$ PPCODE: { #ifdef DBD_ODBC_NO_DATASOURCES /* D_imp_drh(drh); imp_drh->henv = SQL_NULL_HENV; dbd_error(drh, (RETCODE) SQL_ERROR, "data_sources: SOLID d +oesn't implement SQLDataSources()");*/ XSRETURN(0); #else int numDataSources = 0; UWORD fDirection = SQL_FETCH_FIRST; RETCODE rc; UCHAR dsn[SQL_MAX_DSN_LENGTH+1+9 /* strlen("DBI:ODBC:") */]; SWORD dsn_length; UCHAR description[256]; SWORD description_length; D_imp_drh(drh); if (!imp_drh->connects) { rc = SQLAllocEnv(&imp_drh->henv); if (!SQL_ok(rc)) { imp_drh->henv = SQL_NULL_HENV; dbd_error(drh, rc, "data_sources/SQLAllocEnv"); XSRETURN(0); } } strcpy(dsn, "dbi:ODBC:"); while (1) { rc = SQLDataSources(imp_drh->henv, fDirection, dsn+9, /* strlen("DBI:ODBC:") */ SQL_MAX_DSN_LENGTH, &dsn_length, description, sizeof(description), &description_length); if (!SQL_ok(rc)) { if (rc != SQL_NO_DATA_FOUND) { /* * Temporarily increment imp_drh->connects, so * that dbd_error uses our henv. */ imp_drh->connects++; dbd_error(drh, rc, "data_sources/SQLDataSources"); imp_drh->connects--; } break; } ST(numDataSources++) = newSVpv(dsn, dsn_length+9 /* strlen("db +i:ODBC:") */ ); fDirection = SQL_FETCH_NEXT; } if (!imp_drh->connects) { SQLFreeEnv(imp_drh->henv); imp_drh->henv = SQL_NULL_HENV; } XSRETURN(numDataSources); #endif /* no data sources */ }

In reply to Re: Strawberry Perl 64bit on Win7 crashes on DBI-function by mje
in thread Strawberry Perl 64bit on Win7 crashes on DBI-function by theman824

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-24 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found