Comments (10)
From what I remember about the rebuilder, it counts the number of quotes, and looks for closing sets of quotes. That might be the culprit here.
A workaround would be to use placeholders for the blank values ...
UPDATE table SET `value`=:value, `blank`= :blank, `value2` = :value2, `blank2` = :blank2, `value3`=:value3 WHERE id = :id
... and then to pass blank ''
values in the array for those placeholders.
That's a workaround for the interim.
The str_replace()
solution presumes that there are no occurrences of _NULL_
in other literals in the SQL string, which may not be true; in those cases, the query might be modified in unexpected ways. Probably not something that can be added to the library as-is.
However, if you can submit a failing test in a PR, I or someone else can eventually get around to working on the regex.
How does all that sound?
from aura.sql.
I was also thinking to write what @pmjones suggested passing placeholders.
from aura.sql.
Are there any tests for the regex at present? The issue is that I can't be certain what it's meant to detect or not detect as I don't understand the whole syntax at present, or what the goal is.
from aura.sql.
@M1ke I think there is no tests for regular expression itself. Don't know / remember what was the decision to extract it. But it happened in 2.1.0. iirc it was something with the place holder issues I guess.
from aura.sql.
Another workaround is to change your request and to have a newline between conditions:
UPDATE table SET
`value`=:value,
`blank`='',
`value2` = :value2,
`blank2` = '',
`value3`=:value3
WHERE id = :id
This will even have the side effect of rendering you SQL query more readable. We bumped into this bug too at work and that's the workaround we choose to implement
from aura.sql.
@nyamsprod great! .
Thank you for the patch.
from aura.sql.
Is this bug not also related to #104 and #108? In other words: when merging 108, this should be fixed, right?
from aura.sql.
Note to self: add a test for this against #134 after it merges.
from aura.sql.
#134 is obviated; write a test for this against #138 .
from aura.sql.
This appears to be fixed by #138. Thanks for the report!
from aura.sql.
Related Issues (20)
- Bug with pgsql query HOT 5
- DB Reconnection HOT 5
- Auto adding Ticks HOT 8
- Decode json? (to arrays) HOT 1
- Bug in Queryparser for SQLite HOT 3
- Question HOT 1
- Using 2.x and 3.x in parallel HOT 10
- What is the future of this project? HOT 15
- Create GIthub Actions to automatically build and test this package
- PHP 8.1 Compatibility HOT 8
- Type hint incomplete HOT 7
- Scrutinizer Error HOT 1
- Version that doesn't throw deprecation warnings in 8.1 but works in 8.0? HOT 19
- Works with all versions of PHP from 5.6 to 8.1
- Release note HOT 7
- Abandon 4.x ? HOT 2
- Consider tagging / releasing 3.0.1 please ? HOT 2
- How to debug "Column count doesn't match value count"? HOT 1
- Time for 5.0.2/5.1 HOT 4
- Does Aura.Sql suffer of the problem of useless order by on some ORM prefetches ? HOT 2
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 aura.sql.