[Dbix-class] MSSQL/Page/Prefetch problem
Peter Rabbitson
rabbit+dbic at rabbit.us
Sun Jun 21 07:04:54 GMT 2009
Alan Humphrey wrote:
>> This has been fixed in trunk. Please try and report any problems.
>> http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08/trunk/
>>
>
>
> Getting the same results, see below. Also, getting a failure to install DateTime::Format::Pg:
>
> Program output:
>
> ~/birdweb/trunk/BirdWeb-Admin > export DBIC_TRACE=1
> ~/birdweb/trunk/BirdWeb-Admin > perl test.pl
> SELECT * FROM
> (
> SELECT TOP 25 * FROM
> (
> SELECT TOP 50 me.id, me.survey_site_id, me.start_time, me.end_time, me.zero_ref_point, me.survey_date, me.weather, me.precipitation, me.sea_state, me.tide_movement, me.visibility_distance, me.poor_visibility_reason, me.poor_visibility_reason_other, me.equipment, me.binocular_magnification, me.scope_magnification, me.walker_count, me.dog_count, me.power_boat_count, me.unpowered_boat_count, me.other_activities_name, me.other_activities_count, me.comments, me.is_complete, me.raptor1_bird_id, me.raptor1_count, me.raptor1_affect, me.raptor2_bird_id, me.raptor2_count, me.raptor2_affect, me.raptor3_bird_id, me.raptor3_count, me.raptor3_affect, site.site_code, site.site_name, site.position, site.elevation, site.comments FROM surveys me JOIN survey_sites site ON site.site_code = me.survey_site_id ORDER BY survey_site_id ASC, survey_date ASC
> ) AS foo
> ORDER BY survey_site_id DESC, survey_date DESC
> ) AS bar
> ORDER BY survey_site_id, survey_date
>
> :
> DBI Exception: DBD::Sybase::st execute failed: Server message number=8156 severity=16 state=1 line=1 server=SQLA4 text=The column 'comments' was specified multiple times for 'foo'. [for Statement " SELECT * FROM
> (
> SELECT TOP 25 * FROM
> (
> SELECT TOP 50 me.id, me.survey_site_id, me.start_time, me.end_time, me.zero_ref_point, me.survey_date, me.weather, me.precipitation, me.sea_state, me.tide_movement, me.visibility_distance, me.poor_visibility_reason, me.poor_visibility_reason_other, me.equipment, me.binocular_magnification, me.scope_magnification, me.walker_count, me.dog_count, me.power_boat_count, me.unpowered_boat_count, me.other_activities_name, me.other_activities_count, me.comments, me.is_complete, me.raptor1_bird_id, me.raptor1_count, me.raptor1_affect, me.raptor2_bird_id, me.raptor2_count, me.raptor2_affect, me.raptor3_bird_id, me.raptor3_count, me.raptor3_affect, site.site_code, site.site_name, site.position, site.elevation, site.comments FROM surveys me JOIN survey_sites site ON site.site_code = me.survey_site_id ORDER BY survey_site_id ASC, survey_date ASC
> ) AS foo
> ORDER BY survey_site_id DESC, survey_date DESC
> ) AS bar
> ORDER BY survey_site_id, survey_date
>
> "] at /usr/pkg/lib/perl5/site_perl/5.10.0/DBIx/Class/Schema.pm line 1010
Please try the branch[1]. It does *not* pass its SQL output tests yet, as if the
concept is not right the tests will have to be rewritten. Nevertheless this code
should be final, let us know if it works for you.
[1] http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/0.08/branches/mssql_top_fixes/
More information about the DBIx-Class
mailing list