| @@ 555-571 (lines=17) @@ | ||
| 552 | * |
|
| 553 | * @return bool true if no errors, false if errors encountered |
|
| 554 | */ |
|
| 555 | public function renameTable($table, $newName) |
|
| 556 | { |
|
| 557 | if (isset($this->tables[$table])) { |
|
| 558 | $tableDef = &$this->tables[$table]; |
|
| 559 | $newTable = $this->name($newName); |
|
| 560 | $this->queue[] |
|
| 561 | = "ALTER TABLE `{$tableDef['name']}` RENAME TO `{$newTable}`"; |
|
| 562 | $tableDef['name'] = $newTable; |
|
| 563 | } else { // no table established |
|
| 564 | $this->lastError = _DB_XMF_TABLE_IS_NOT_DEFINED; |
|
| 565 | $this->lastErrNo = -1; |
|
| 566 | ||
| 567 | return false; |
|
| 568 | } |
|
| 569 | ||
| 570 | return true; |
|
| 571 | } |
|
| 572 | ||
| 573 | /** |
|
| 574 | * Add alter table table_options (ENGINE, DEFAULT CHARSET, etc.) |
|
| @@ 582-597 (lines=16) @@ | ||
| 579 | * |
|
| 580 | * @return bool true if no errors, false if errors encountered |
|
| 581 | */ |
|
| 582 | public function setTableOptions($table, $options) |
|
| 583 | { |
|
| 584 | // ENGINE=MEMORY DEFAULT CHARSET=utf8; |
|
| 585 | if (isset($this->tables[$table])) { |
|
| 586 | $tableDef = &$this->tables[$table]; |
|
| 587 | $this->queue[]="ALTER TABLE `{$tableDef['name']}` {$options} "; |
|
| 588 | $tableDef['options'] = $options; |
|
| 589 | } else { // no table established |
|
| 590 | $this->lastError = _DB_XMF_TABLE_IS_NOT_DEFINED; |
|
| 591 | $this->lastErrNo = -1; |
|
| 592 | ||
| 593 | return false; |
|
| 594 | } |
|
| 595 | ||
| 596 | return true; |
|
| 597 | } |
|
| 598 | ||
| 599 | ||
| 600 | /** |
|