Hi!
>>>>> "Jim" == Jim O'Quinn <oquinn@stripped> writes:
>> > T_SOME_TABLE.ID - auto_increment
>> > T_SOME_TALBE.SOME_CHAR - char
>> >
>> > my $obj = new T_SOME_TABLE();
>> > $obj->setSomeChar(12);
>> > $obj->store; # does update/insert
>> >
>> >Then I can do:
>> >
>> > print $obj->getSomeChar; # a '12' shows up
>> > print $obj->getId; # here is where I need to get
>> > # the value that was auto_incremented
>>
<cut>
Jim> In any case, all this junk runs under Apache
Jim> mod_perl and I'm thinking about caching all
Jim> the database meta-data in the web server on
Jim> web server startup where I can pull it from
Jim> a variable and not have to run an extra SQL
Jim> statement and parse the results to determine
Jim> if I've got a AUTO_INC or not, plus pulling
Jim> it from a variable is faster than makeing
Jim> db calls to get the meta-data. All of this
Jim> came about b/c of performance tweaking anyway.
<cut>
One option is of course to patch the msql-mysql-modules so that you
can test if a column is AUTO_INCREMENT:
To fix this, you can grep after IS_BLOB in the source and add a very
similar handling of IS_AUTO:
Add near:
case AV_ATTRIB_IS_BLOB:
sv = boolSV(IS_BLOB(curField->flags));
break;
something like:
case AV_ATTRIB_IS_AUTO:
sv = boolSV(curField->flags & AUTO_INCREMENT_FLAG ? 1: 0);
break;
A quick search with "grep -i is_blob */*.c" should help you find the
other things to patch...
Regards,
Monty