| @@ 2656-2681 (lines=26) @@ | ||
| 2653 | * |
|
| 2654 | * @return bool|int 0 success |
|
| 2655 | */ |
|
| 2656 | public function alterTable($table, $name, $owner, $schema, $comment, $tablespace) |
|
| 2657 | { |
|
| 2658 | $data = $this->getTable($table); |
|
| 2659 | ||
| 2660 | if ($data->recordCount() != 1) { |
|
| 2661 | return -2; |
|
| 2662 | } |
|
| 2663 | ||
| 2664 | $status = $this->beginTransaction(); |
|
| 2665 | if ($status != 0) { |
|
| 2666 | $this->rollbackTransaction(); |
|
| 2667 | ||
| 2668 | return -1; |
|
| 2669 | } |
|
| 2670 | ||
| 2671 | $status = $this->_alterTable($data, $name, $owner, $schema, $comment, $tablespace); |
|
| 2672 | ||
| 2673 | if ($status != 0) { |
|
| 2674 | $this->rollbackTransaction(); |
|
| 2675 | ||
| 2676 | return $status; |
|
| 2677 | } |
|
| 2678 | ||
| 2679 | return $this->endTransaction(); |
|
| 2680 | } |
|
| 2681 | ||
| 2682 | /** |
|
| 2683 | * Protected method which alter a table |
|
| 2684 | * SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION. |
|
| @@ 4272-4296 (lines=25) @@ | ||
| 4269 | * |
|
| 4270 | * @return bool|int 0 success |
|
| 4271 | */ |
|
| 4272 | public function alterView($view, $name, $owner, $schema, $comment) |
|
| 4273 | { |
|
| 4274 | $data = $this->getView($view); |
|
| 4275 | if ($data->recordCount() != 1) { |
|
| 4276 | return -2; |
|
| 4277 | } |
|
| 4278 | ||
| 4279 | $status = $this->beginTransaction(); |
|
| 4280 | if ($status != 0) { |
|
| 4281 | $this->rollbackTransaction(); |
|
| 4282 | ||
| 4283 | return -1; |
|
| 4284 | } |
|
| 4285 | ||
| 4286 | $status = $this->_alterView($data, $name, $owner, $schema, $comment); |
|
| 4287 | ||
| 4288 | if ($status != 0) { |
|
| 4289 | $this->rollbackTransaction(); |
|
| 4290 | ||
| 4291 | return $status; |
|
| 4292 | } |
|
| 4293 | ||
| 4294 | return $this->endTransaction(); |
|
| 4295 | } |
|
| 4296 | ||
| 4297 | /** |
|
| 4298 | * Returns all details for a particular view. |
|
| 4299 | * |
|