classCloneInstance
final class CloneInstance
implements Statement
uses Snapshot
@visibility public.CLONE INSTANCE FROM user@host:port IDENTIFIED BY 'password' [DATA DIRECTORY [=] 'directory'] [REQUIRE [NO] SSL]: a request to clone a remote server (MySQL 8.0.17 and later).
Mirrors Sql_cmd_clone for a remote clone. Rule: MYSQL-CLONE-INSTANCE-001. The account, the colon and the port are written without spaces: the server rejects a space around the colon as a syntax error. Without a directory the clone replaces the data of the local server; without an SSL choice the server's clone_ssl settings decide. The equals sign is optional and not written. The statement names no relation and has no facts. Source: https://dev.mysql.com/doc/refman/8.4/en/clone.html. Status: Implemented.
$clone = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("clone instance from 'u'@'h':3306 identified by 'p' data directory '/d' require no ssl");
[$clone->toString(), $clone->statement->port->text, $clone->statement->requireSsl] // => ["CLONE INSTANCE FROM u@h:3306 IDENTIFIED BY 'p' DATA DIRECTORY '/d' REQUIRE NO SSL", '3306', false]Properties§
public Account $donorpublic Numeral $portpublic Text $passwordpublic Text|null $directory = nullpublic bool|null $requireSsl = nullMethods§
public function __construct(
public Account $donor,
public Numeral $port,
public Text $password,
public Text|null $directory = null,
public bool|null $requireSsl = null,
)Parameters
$donor | Account | The account the clone connects as, with the donor's host |
$port | Numeral | The donor's port |
$password | Text | The account's password |
$directory | Text|null | The directory the data is cloned into, when written |
$requireSsl | bool|null | Whether REQUIRE SSL (true) or REQUIRE NO SSL (false) is written; null when absent |
public function deriveStatement(Derivation $derivation): voidHas nothing to derive: the request names no relation and no value.
Parameters
$derivation | Derivation |
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CloneInstanceTestcalls