Page MenuHomePhabricator

sql.php with readline eats semicolon
Closed, ResolvedPublic

Description

When running sql.php interactively and repealing a previous statement, the history line is missing the trailing semicolon (at least when using sqlite as a backend).

how to reproduce:

Launch script:
php sql.php

Write a command and execute it by pressing enter
SELECT * FROM job;

Script outputs:
Query OK, 0 row(s) affected
>

Press key up to repeal previous command. Script output should look as:

> SELECT * FROM job;
Query OK, 0 row(s) affected
> SELECT * FROM job

The last line is the repealed one which is missing the semicolon.

~/.mwsql_history gives me:

select\040*\040from\040job
select\040*\040from\040jobselect\040*\040from\040job
SELECT\040*\040FROM\040job

Indeed missing the semicolon.

Cause might be commit ebf916f3fb528bba0fcb5626701815a1810463de for bug 27207


Version: 1.20.x
Severity: minor

Details

Reference
bz37020

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:27 AM
bzimport set Reference to bz37020.
bzimport added a subscriber: Unknown Object (MLST).

https://gerrit.wikimedia.org/r/29952 adds the database delimiter to the readline history file.