Comments (6)
I've done a temporary patch into my code.
$sql = 'SELECT
name, 1, test;'
$parser = new PHPSQLParser($sql); // Fail
$sql = preg_replace('/^(SELECT)(\s)(\s+)/si', '$1 ', $sql);
$parser = new PHPSQLParser($sql); // Success
Original comment by [email protected]
on 14 Dec 2010 at 4:37
from php-sql-parser.
i did it in "split_sql($sql)"
change
$sql = str_replace(array('\\\'','\\"'),array("''",'""'), $sql)
to
$sql = str_replace(array("\n","\r",'\\\'','\\"'),array(' ',' ',"''",'""'),
$sql);
Original comment by [email protected]
on 17 Jan 2011 at 8:08
from php-sql-parser.
here is a diff which
* makes the reserved and functions array static (results in faster parsing)
* newlines are being replaced with ' ' before parse;
* the sql syntax regarding fulltext i.e. 'match mycol against ('+*foobar*' IN
BOOLEAN MODE)' is handled better (at least for my needs)
regards
Patrik
Original comment by [email protected]
on 17 Jan 2011 at 9:58
Attachments:
from php-sql-parser.
Thank, I will patch my own version and try it.
Original comment by [email protected]
on 17 Jan 2011 at 11:58
from php-sql-parser.
Thanks for the report - I'll review and incorporate your changes.
Original comment by [email protected]
on 4 Feb 2011 at 8:42
- Changed state: Accepted
from php-sql-parser.
Thanks again for your contribution.
I incorporated your match/against improvement. I had already made a newline
fix.
I have not yet switched to static arrays.
I updated the t/select.php test.
Original comment by [email protected]
on 21 Mar 2011 at 7:27
- Changed state: Verified
from php-sql-parser.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-sql-parser.