[seasar-php:138] S2PagerのuseLimitOffsetQuery=trueについて

ISHITOYA Kentaro [E-MAIL ADDRESS DELETED]
2007年 5月 21日 (月) 20:15:13 JST


石戸谷です。

メールの連投申し訳ありません。
S2Pagerについて報告です。

PostgreSQL8.2、PHP5.2.2を使っているのですが、
<property name="useLimitOffsetQuery">true</property>
を指定すると、下記エラーが出ます。

exception 'S2Dao_SQLRuntimeException' with message 'SQLException
occured, because SQLSTATE[HY093]: Invalid parameter number: number of
bound variables does not match number of tokens' in
C:\cygwin\home\kentaro\www\cmmesse\lib\s2dao.php5\build\s2dao.php5\s2dao.core.classes.php:538


実行時の518行目、$this->bindArgsの引数、Statement, $args1, $args2は下記
です。また最後は、DEBUGログです。
useLimitOffsetQueryをfalseにすると正常に答えが返ってきます。
以上よろしくおねがいいたします。

object(PDOStatement)#3138 (1) {
  ["queryString"]=>
  string(1055) "SELECT addresses.id, addresses.contact_id,
addresses.address_type_id, addresses.prefecture_id,
addresses.priority_id, addresses.country_id, addresses.postal,
addresses.city, addresses.street, addresses.lot,
addresses.city_readings, addresses.street_readings,
addresses.lot_readings, addresses.geocode, contactId.id AS id_0,
addressTypeId.id AS id_1, addressTypeId.name AS name_1, prefectureId.id
AS id_2, prefectureId.district_id AS district_id_2, prefectureId.name AS
name_2, priorityId.id AS id_3, priorityId.name AS name_3, countryId.id
AS id_4, countryId.name AS name_4, countryId.legalname AS legalname_4
FROM addresses LEFT OUTER JOIN contacts contactId ON
addresses.contact_id = contactId.id LEFT OUTER JOIN address_types
addressTypeId ON addresses.address_type_id = addressTypeId.id LEFT OUTER
JOIN prefectures prefectureId ON addresses.prefecture_id =
prefectureId.id LEFT OUTER JOIN priorities priorityId ON
addresses.priority_id = priorityId.id LEFT OUTER JOIN countries
countryId ON addresses.country_id = countryId.id WHERE  contactId.id = ? "
}
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(0)
  [2]=>
  int(-1)
}
array(3) {
  [0]=>
  string(4) "NULL"
  [1]=>
  string(7) "integer"
  [2]=>
  string(7) "integer"
}
[DEBUG]  - SELECT addresses.id, addresses.contact_id,
addresses.address_type_id, addresses.prefecture_id,
addresses.priority_id, addresses.country_id, addresses.postal,
addresses.city, addresses.street, addresses.lot,
addresses.city_readings, addresses.street_readings,
addresses.lot_readings, addresses.geocode, contactId.id AS id_0,
addressTypeId.id AS id_1, addressTypeId.name AS name_1, prefectureId.id
AS id_2, prefectureId.district_id AS district_id_2, prefectureId.name AS
name_2, priorityId.id AS id_3, priorityId.name AS name_3, countryId.id
AS id_4, countryId.name AS name_4, countryId.legalname AS legalname_4
FROM addresses LEFT OUTER JOIN contacts contactId ON
addresses.contact_id = contactId.id LEFT OUTER JOIN address_types
addressTypeId ON addresses.address_type_id = addressTypeId.id LEFT OUTER
JOIN prefectures prefectureId ON addresses.prefecture_id =
prefectureId.id LEFT OUTER JOIN priorities priorityId ON
addresses.priority_id = priorityId.id LEFT OUTER JOIN countries
countryId ON addresses.country_id = countryId.id WHERE  contactId.id = 0


seasar-php メーリングリストの案内