mysqldump-php icon indicating copy to clipboard operation
mysqldump-php copied to clipboard

remove execution tokens option

Open KevsRepos opened this issue 2 years ago • 4 comments

What about a flag like add-execution-tokens which is true by default, but can be set to false if necessary. This way, you would have a file with "raw" sql statements which can be parsed by php's sql execution methods.

KevsRepos avatar Feb 16 '23 12:02 KevsRepos

Exactly what statements can't be send to PHP execution method?

What about a flag like add-execution-tokens which is true by default, but can be set to false if necessary. This way, you would have a file with "raw" sql statements which can be parsed by php's sql execution methods.

Message ID: @.***>

ifsnop avatar Feb 16 '23 14:02 ifsnop

These sql execution tokens which look like that: /* SOME STATEMENT */;

I was able to trim them iut with a regex, but a flag would be the nice and easy-to-use way.

KevsRepos avatar Feb 16 '23 16:02 KevsRepos

Those tokens are there to ensure Mysql/Mariadb compatibility between dumps and restores. Could you share the regex, so I can update the wiki?

ifsnop avatar May 16 '23 16:05 ifsnop

$sql = trim(preg_replace("/\/\*(?:.|\n)*?\*\/\s*;/", '', $file));

@ifsnop This is how I am using it.

KevsRepos avatar May 16 '23 17:05 KevsRepos