Changeset 18775 for branches/version-2_5-dev/data/class/SC_Query.php
- Timestamp:
- 2010/08/04 13:52:27 (16 years ago)
- bzr:base-revision:
- svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18774
- bzr:committer:
- Kentaro Ohkouchi <[email protected]>
- bzr:file-ids:
data/class/SC_Query.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Query.php
data/class/db/SC_DB_DBFactory.php 15123@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fdb%2FSC_DB_DBFactory.php
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php 15123@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fdb%2Fdbfactory%2FSC_DB_DBFactory_MYSQL.php
data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php 15123@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fdb%2Fdbfactory%2FSC_DB_DBFactory_PGSQL.php
data/class/helper/SC_Helper_DB.php 15176@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_DB.php
data/class/pages/shopping/LC_Page_Shopping_Complete.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Complete.php
data/class/util/SC_Utils.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Futil%2FSC_Utils.php
html/install/index.php 16809@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Findex.php
html/install/sql/create_table_mysql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_mysql.sql- bzr:mapping-version:
- v4
- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- [email protected]
- bzr:revno:
- 2258
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:text-parents:
data/class/db/SC_DB_DBFactory.php [email protected]
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php [email protected]
data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php [email protected]
data/class/helper/SC_Helper_DB.php [email protected]
data/class/pages/shopping/LC_Page_Shopping_Complete.php [email protected]
data/class/util/SC_Utils.php [email protected]
html/install/index.php [email protected]
html/install/sql/create_table_mysql.sql svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18764- bzr:timestamp:
- 2010-08-04 13:52:24.183000088 +0900
- bzr:user-agent:
- bzr2.1.2+bzr-svn1.0.2
- svn:original-date:
- 2010-08-04T04:52:24.183000Z
- File:
-
- 1 edited
-
branches/version-2_5-dev/data/class/SC_Query.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/SC_Query.php
r18774 r18775 161 161 162 162 $sth = $this->conn->prepare($sql); 163 if (PEAR::isError($sth)) { 164 /* 165 * XXX インストーラのテーブルチェックに失敗してしまう. 166 * エラーハンドリングの方法を要検討 167 */ 168 return; 169 } 163 170 $affected = $sth->execute($arrval); 164 171 … … 487 494 488 495 if (PEAR::isError($result)) { 489 trigger_error($result->getMessage(), E_USER_ERROR); 496 /* 497 * XXX インストーラのテーブルチェックに失敗してしまう. 498 * エラーハンドリングの方法を要検討 499 */ 500 //trigger_error($result->getMessage(), E_USER_ERROR); 490 501 } 491 502 … … 495 506 /** 496 507 * auto_incrementを取得する. 508 * 509 * XXX MDB2 の sequence 関数を使用する 497 510 * 498 511 * @param string $table_name テーブル名 … … 501 514 function get_auto_increment($table_name){ 502 515 // ロックする 503 $this-> query("LOCK TABLES $table_name WRITE");516 $this->conn->exec("LOCK TABLES $table_name WRITE"); 504 517 505 518 // 次のIncrementを取得 506 $arrRet = $this->getAll("SHOW TABLE STATUS LIKE ?", array($table_name));519 $arrRet = $this->getAll("SHOW TABLE STATUS LIKE ". $this->quote($table_name)); 507 520 $auto_inc_no = $arrRet[0]["Auto_increment"]; 508 521 509 522 // 値をカウントアップしておく 510 $this-> query("ALTER TABLE $table_name AUTO_INCREMENT=?" , $auto_inc_no + 1);523 $this->conn->exec("ALTER TABLE $table_name AUTO_INCREMENT=" . $this->quote($auto_inc_no + 1)); 511 524 512 525 // 解除する 513 $this-> query('UNLOCK TABLES');526 $this->conn->exec('UNLOCK TABLES'); 514 527 515 528 return $auto_inc_no; 516 529 } 530 531 /** 532 * 値を適切にクォートする. 533 * 534 * TODO MDB2 に対応するための暫定的な措置. 535 * ブレースホルダが使用できない実装があるため. 536 * 本来であれば, MDB2::prepare() を適切に使用するべき 537 * 538 * @see MDB2::quote() 539 * @param string $val クォートを行う文字列 540 * @return string クォートされた文字列 541 */ 542 function quote($val) { 543 return $this->conn->quote($val); 544 } 517 545 } 518 546
Note: See TracChangeset
for help on using the changeset viewer.
