class Operations (View source)

Set of functions with the operations section in phpMyAdmin

Methods

__construct(DatabaseInterface $dbi, Relation $relation, TableMover $tableMover)

No description

void
runProcedureAndFunctionDefinitions(string $db, DatabaseName $newDatabaseName)

Run the Procedure definitions and function definitions

void
createDbBeforeCopy(UserPrivileges $userPrivileges, DatabaseName $newDatabaseName)

Create database before copy

array
getViewsAndCreateSqlViewStandIn(array $tables, ExportSql $exportSqlPlugin, string $db, DatabaseName $newDatabaseName)

Get views as an array and create SQL view stand-in

array
copyTables(array $tables, bool $move, string $db, DatabaseName $newDatabaseName)

Get sql query for copy/rename table and boolean for whether copy/rename or not

void
runEventDefinitionsForDb(string $db, DatabaseName $newDatabaseName)

Run the EVENT definition for selected database

void
handleTheViews(array $views, bool $move, string $db, DatabaseName $newDatabaseName)

Handle the views, return the boolean value whether table rename/copy or not

void
adjustPrivilegesMoveDb(UserPrivileges $userPrivileges, string $oldDb, DatabaseName $newDatabaseName)

Adjust the privileges after Renaming the db

void
adjustPrivilegesCopyDb(UserPrivileges $userPrivileges, string $oldDb, DatabaseName $newDatabaseName)

Adjust the privileges after Copying the db

void
createAllAccumulatedConstraints(array $sqlConstraints, DatabaseName $newDatabaseName)

Create all accumulated constraints

void
duplicateBookmarks(bool $error, string $db, DatabaseName $newDatabaseName)

Duplicate the bookmarks for the db (done once for each db)

array
getPossibleRowFormat()

Get array of possible row formats

array
array
getForeignersForReferentialIntegrityCheck(array $urlParams, bool $hasRelationFeature)

No description

array
getTableAltersArray(Table $pmaTable, string $packKeys, string $checksum, string $pageChecksum, string $delayKeyWrite, string $rowFormat, string $newTblStorageEngine, string $transactional, string $tableCollation, string $tableStorageEngine)

Get table alters array

array
getWarningMessagesArray(mixed $newTableStorageEngine)

Get warning messages array

void
adjustPrivilegesRenameOrMoveTable(UserPrivileges $userPrivileges, string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after renaming/moving a table

void
adjustPrivilegesCopyTable(UserPrivileges $userPrivileges, string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after copying a table

void
changeAllColumnsCollation(string $db, string $table, string $tableCollation)

Change all collations and character sets of all columns in table

moveOrCopyTable(UserPrivileges $userPrivileges, string $db, string $table)

Move or copy a table

Details

__construct(DatabaseInterface $dbi, Relation $relation, TableMover $tableMover)

No description

Parameters

DatabaseInterface $dbi
Relation $relation
TableMover $tableMover

void runProcedureAndFunctionDefinitions(string $db, DatabaseName $newDatabaseName)

Run the Procedure definitions and function definitions

to avoid selecting alternatively the current and new db we would need to modify the CREATE definitions to qualify the db name

Parameters

string $db

database name

DatabaseName $newDatabaseName

Return Value

void

void createDbBeforeCopy(UserPrivileges $userPrivileges, DatabaseName $newDatabaseName)

Create database before copy

Parameters

UserPrivileges $userPrivileges
DatabaseName $newDatabaseName

Return Value

void

array getViewsAndCreateSqlViewStandIn(array $tables, ExportSql $exportSqlPlugin, string $db, DatabaseName $newDatabaseName)

Get views as an array and create SQL view stand-in

Parameters

array $tables

array of all tables in given db or dbs

ExportSql $exportSqlPlugin

export plugin instance

string $db

database name

DatabaseName $newDatabaseName

Return Value

array

array copyTables(array $tables, bool $move, string $db, DatabaseName $newDatabaseName)

Get sql query for copy/rename table and boolean for whether copy/rename or not

Parameters

array $tables

array of all tables in given db or dbs

bool $move

whether database name is empty or not

string $db

database name

DatabaseName $newDatabaseName

Return Value

array

SQL queries for the constraints

void runEventDefinitionsForDb(string $db, DatabaseName $newDatabaseName)

Run the EVENT definition for selected database

to avoid selecting alternatively the current and new db we would need to modify the CREATE definitions to qualify the db name

Parameters

string $db

database name

DatabaseName $newDatabaseName

Return Value

void

void handleTheViews(array $views, bool $move, string $db, DatabaseName $newDatabaseName)

Handle the views, return the boolean value whether table rename/copy or not

Parameters

array $views

views as an array

bool $move

whether database name is empty or not

string $db

database name

DatabaseName $newDatabaseName

Return Value

void

void adjustPrivilegesMoveDb(UserPrivileges $userPrivileges, string $oldDb, DatabaseName $newDatabaseName)

Adjust the privileges after Renaming the db

Parameters

UserPrivileges $userPrivileges
string $oldDb

Database name before renaming

DatabaseName $newDatabaseName

Return Value

void

void adjustPrivilegesCopyDb(UserPrivileges $userPrivileges, string $oldDb, DatabaseName $newDatabaseName)

Adjust the privileges after Copying the db

Parameters

UserPrivileges $userPrivileges
string $oldDb

Database name before copying

DatabaseName $newDatabaseName

Return Value

void

void createAllAccumulatedConstraints(array $sqlConstraints, DatabaseName $newDatabaseName)

Create all accumulated constraints

Parameters

array $sqlConstraints

array of sql constraints for the database

DatabaseName $newDatabaseName

Return Value

void

void duplicateBookmarks(bool $error, string $db, DatabaseName $newDatabaseName)

Duplicate the bookmarks for the db (done once for each db)

Parameters

bool $error

whether table rename/copy or not

string $db

database name

DatabaseName $newDatabaseName

Return Value

void

array getPossibleRowFormat()

Get array of possible row formats

Return Value

array

array getPartitionMaintenanceChoices()

No description

Return Value

array

array getForeignersForReferentialIntegrityCheck(array $urlParams, bool $hasRelationFeature)

No description

Parameters

array $urlParams

Array of url parameters.

bool $hasRelationFeature

If relation feature is enabled.

Return Value

array

array getTableAltersArray(Table $pmaTable, string $packKeys, string $checksum, string $pageChecksum, string $delayKeyWrite, string $rowFormat, string $newTblStorageEngine, string $transactional, string $tableCollation, string $tableStorageEngine)

Get table alters array

Parameters

Table $pmaTable

The Table object

string $packKeys

pack keys

string $checksum

value of checksum

string $pageChecksum

value of page checksum

string $delayKeyWrite

delay key write

string $rowFormat

row format

string $newTblStorageEngine

table storage engine

string $transactional

value of transactional

string $tableCollation

collation of the table

string $tableStorageEngine

Return Value

array

array getWarningMessagesArray(mixed $newTableStorageEngine)

Get warning messages array

Parameters

mixed $newTableStorageEngine

Return Value

array

void adjustPrivilegesRenameOrMoveTable(UserPrivileges $userPrivileges, string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after renaming/moving a table

Parameters

UserPrivileges $userPrivileges
string $oldDb

Database name before table renaming/moving table

string $oldTable

Table name before table renaming/moving table

string $newDb

Database name after table renaming/ moving table

string $newTable

Table name after table renaming/moving table

Return Value

void

void adjustPrivilegesCopyTable(UserPrivileges $userPrivileges, string $oldDb, string $oldTable, string $newDb, string $newTable)

Adjust the privileges after copying a table

Parameters

UserPrivileges $userPrivileges
string $oldDb

Database name before table copying

string $oldTable

Table name before table copying

string $newDb

Database name after table copying

string $newTable

Table name after table copying

Return Value

void

void changeAllColumnsCollation(string $db, string $table, string $tableCollation)

Change all collations and character sets of all columns in table

Parameters

string $db

Database name

string $table

Table name

string $tableCollation

Collation Name

Return Value

void

Message moveOrCopyTable(UserPrivileges $userPrivileges, string $db, string $table)

Move or copy a table

Parameters

UserPrivileges $userPrivileges
string $db

current database name

string $table

current table name

Return Value

Message