Deprecate and properly handle empty lhs
[dbsrgits/SQL-Abstract.git] / Changes
1 Revision history for SQL::Abstract
2
3     - New exportable functions: is_literal_value($) and is_plain_value($)
4     - New attribute 'escape_char' allowing for proper escape of quote_chars
5       present in an identifier
6     - Deprecate { "" => \... } constructs
7     - Treat { -value => undef } as plain undef in all cases
8     - Explicitly throw on { -ident => undef }
9
10 revision 1.78  2014-05-28
11 ----------------------------
12     - Fix parsing of binary ops to correctly take up only a single LHS
13       element, instead of gobbling up the entire parse-to-date
14     - Explicitly handle ROW_NUMBER() OVER as the snowflake-operator it is
15     - Improve signatures/documentation of is_same_sql_bind / eq_sql_bind
16     - Retire script/format-sql - the utility needs more work to be truly
17       end-user convenient
18
19 revision 1.77  2014-01-17
20 ----------------------------
21     - Reintroduce { -not => undef } column operator (regression from 1.75)
22
23 revision 1.75  2013-12-27
24 ----------------------------
25     - *UPCOMING INCOMPATIBLE BUGFIX*: SQLA used to generate incorrect SQL
26       on undef-containing lists fed to -in and -not_in. An exception will
27       be raised for a while before properly fixing this, to avoid quiet
28       but subtle changes to query results in production
29     - Deprecate and warn when supplying an empty arrayref to like/not_like
30       operators (likely to be removed before 2.0)
31
32     - Warn when using an inequality operator with a multi-value array to
33       arrive at what amounts to a 1=1 condition (no pre-2.0 plans to fix
34       this behavior due to backwards comp concerns)
35     - Fix false negative comparison of ORDER BY <function> ASC
36     - More improvements of incorrect parsing (placeholder at end of list
37       element)
38     - Fix typos in POD and comments (RT#87776)
39     - Augment -not_bool example with nesting (RT#89601)
40
41 revision 1.74  2013-06-04
42 ----------------------------
43     - Fix insufficient parenthesis unroll during operator comparison
44     - 'ORDER BY foo' and 'ORDER BY foo ASC' are now considered equal
45       by default (with a switch to reenable old behavior when necessary)
46     - Change parser to not eagerly slurp RHS expressions it doesn't recognize
47
48 revision 1.73  2012-07-10
49 ----------------------------
50     - Fix parsing of ORDER BY foo + ?
51     - Stop filling in placeholders in `format-sql` since it does not support
52       passing values for them anyway
53     - Fix parsing of NOT EXISTS
54     - Fix over-eager parenthesis unrolling
55     - Fix deep recursion warnings while parsing obnoxiously long sql statements
56     - Fix incorrect comparison of malformed lists
57     - Fix incorrect reporting of mismatch-members in SQLA::Test
58     - Migrate the -ident operator from DBIC into SQLA
59     - Migrate the -value operator from DBIC into SQLA
60
61 revision 1.72  2010-12-21
62 ----------------------------
63     - Extra checks of search arguments for possible SQL injection attacks
64     - Remove excess parentheses in debug SQL
65     - Fix parsing of foo.* in SQLA::Tree
66     - Fix bindtype fail when using -between with arrayrefref literals
67     - Add handling for NULL for -in
68     - The -nest operator has entered semi-deprecated status and has been
69       undocumented. Please do not use it in new code
70
71 revision 1.71  2010-11-09
72 ----------------------------
73     - Add EXECUTING for clarity of long running SQL
74     - Add "squash_repeats" option to fix it such that repeated SQL gets ellided
75       except for placeholders
76     - Highlight transaction keywords
77     - Highlight HAVING
78     - Leave quotes from DBIC in bindargs
79     - Add error checking on "profile" for SQLA::Tree
80     - Hide bulk inserts from DBIx::Class
81     - Fix missing doc (RT#62587)
82     - Format functions in MySQL-friendly manner foo( ... ) vs foo ( ... )
83
84 revision 1.69  2010-10-22
85 ----------------------------
86     - Add quotes for populated placeholders and make the background
87       magenta instead of cyan
88     - Color and indent pagination keywords
89     - Fix a silly bug which broke placeholder fill-in in DBIC
90     - Installs format-sql to format SQL passed in over STDIN
91     - Switch the tokenizer to precompiled regexes (massive speedup)
92     - Rudimentary handling of quotes ( 'WHERE' vs WHERE )
93     - Fix extended argument parsing by IN/BETWEEN
94     - Add proper handling of lists (foo,bar,?)
95     - Better handling of generic -function's during AST construction
96     - Special handle IS NOT? NULL
97     - Make sure unparse() does not destroy a passed in \@bindargs
98     - Support ops with _'s in them (valid in Oracle)
99     - Properly parse both types of default value inserts
100     - Allow { -func => $val } as arguments to UPDATE
101
102 revision 1.68  2010-09-16
103 ----------------------------
104     - Document methods on Tree
105     - Add affordances for color coding placeholders
106     - Change ::Tree::whitespace to whitespace_keyword
107
108 revision 1.67_03  2010-09-11
109 ----------------------------
110     - Add docs for SQL::Abstract::Tree->new
111     - correcty merge profile and parameters
112     - added fill_in_placeholders option for excellent copy/pasta
113
114 revision 1.67_02  2010-09-08
115 ----------------------------
116     - rename DBIx::Class::Storage::PrettyPrinter to DBIx::Class::Storage::Debug::PrettyPrint
117     - decreased a lot of indentation from ::Tree
118     - cleaned up handling of newlines inside of parens
119
120 revision 1.67_01  2010-09-06
121 ----------------------------
122     - Add SQL::Abstract::Tree
123     - Add unindexed DBIx::Class::Storage::PrettyPrinter
124     - Better documentation of undef/NULL in where clause
125     - Depend on bugfixed Module::Install (now again installs
126       on old < 5.8.3 perls)
127
128 revision 1.67  2010-05-31 14:21 (UTC)
129 ----------------------------
130     - Fix SQL::Test failure when first chunk is an unrecognized
131       literal
132     - Generic -not operator tests
133     - More columns-bindtype assertion checks
134
135 revision 1.66  2010-04-27 02:44 (UTC)
136 ----------------------------
137     - Optimized the quoting mechanism, winning nearly 10%
138       speedup on repeatable sql generation
139
140 revision 1.65  2010-04-11 19:59 (UTC)
141 ----------------------------
142     - Rerelease last version to not include .svn files
143       and grab MANIFEST.SKIP from DBIx::Class so it
144       won't happen again
145
146 revision 1.64  2010-04-11 16:58 (UTC)
147 ----------------------------
148     - Fix multiple generic op handling regressions by
149       reverting the auto-equality assumption (turned out
150       to be a very very bad idea)
151
152 revision 1.63  2010-03-24 09:56 (UTC)
153 ----------------------------
154     - Add ILIKE to the core list of comparision ops
155
156 revision 1.62  2010-03-15 11:06 (UTC)
157 ----------------------------
158     - Fixed open outer parens for a multi-line literal
159     - Allow recursively-nested column-functions in WHERE
160     - Bumped minimum perl to 5.6.2 and changed tests to
161       rely on core dependencies
162
163 revision 1.61  2010-02-05 16:28 (UTC)
164 ----------------------------
165     - Allow INSERT to take additional attributes
166     - Support for INSERT ... RETURNING
167     - Another iteration of SQL::Abstract::Test fixes and improvements
168
169 revision 1.60  2009-09-22 11:03 (UTC)
170 ----------------------------
171     - fix a well masked error in the sql-test tokenizer
172
173 revision 1.59  2009-09-22 08:39 (UTC)
174 ----------------------------
175     - fixed a couple of untrapped undefined warnings
176     - allow -in/-between to accept literal sql in all logical
177       variants - see POD for details
178     - unroll multiple parenthesis around IN arguments to accomodate
179       crappy databases
180
181 revision 1.58  2009-09-04 15:20 (UTC)
182 ----------------------------
183     - expanded the scope of -bool and -not_bool operators
184     - added proper testing support
185
186 revision 1.57  2009-09-03 20:18 (UTC)
187 ----------------------------
188     - added -bool and -not_bool operators
189
190 revision 1.56  2009-05-30 16:31 (UTC)
191 ----------------------------
192     - support for \[$sql, @bind] in order_by clauses e.g.:
193       { -desc => \['colA LIKE ?', 'somestring'] }
194
195 revision 1.55  2009-05-17 22:54 (UTC)
196 ----------------------------
197     - make sure that sql generation does not mutate the supplied
198       where condition structure
199
200 revision 1.54  2009-05-07 17:23 (UTC)
201 ----------------------------
202     - allow special_operators to take both code refs and method names
203       (makes it possible to properly subclass the builtin ones)
204
205 revision 1.53  2009-04-30 14:58 (UTC)
206 ----------------------------
207     - make sure hash keys are sorted in all search sub-conditions
208     - switch installer from EU::MM to M::I
209
210 revision 1.52  2009-04-28 23:14 (UTC)
211 ----------------------------
212     - allow -between to handle [\"", \""] and \["", @bind]
213     - allow order_by to handle -asc|desc => [qw/colA colB/] (artifact from DBIx::Class)
214     - more tests and clearing up of some corner cases
215     - t/10test.t does not run by default (developer only, too cpu intensive)
216
217 ----------------------------
218 revision 1.51  2009-03-28 10:00 (UTC)
219     - fixed behavior of [-and => ... ] depending on the current
220       condition scope. This introduces backwards comp with 1.24
221
222 ----------------------------
223 revision 1.50  2009-03-10 12:30 (UTC)
224     - fixed the problem with values() not behaving the same as the rest of the code (RT#43483)
225     - fixed interjecting arrayrefref into a where clause
226     - added value-only insert test with a literal SQL snippet
227     - cleanup and enhancement of t/03values.t
228     - better handling of borked SQL in tests
229     - deal properly with parentheses in is_same_sql_bind()
230     - fixed test subs (is_same_*) in SQL::Abstract::Test to return the correct test value
231     - do not version MANIFEST
232
233     Version 1.50 was a major internal refactoring of SQL::Abstract.
234     Great care has been taken to preserve the published behavior
235     documented in previous versions in the 1.* family; however,
236     some features that were previously undocumented, or behaved.
237     differently from the documentation, had to be changed in order
238     to clarify the semantics. Hence, client code that was relying
239     on some dark areas of SQL::Abstract v1.* might behave differently
240     in v1.50.
241
242 ----------------------------
243 revision 1.49_04  2009-03-03
244     - add support for a [\%column_meta => value] bind value format
245
246 ----------------------------
247 revision 1.49_03  2009-02-17
248     - clarify syntax of \['...', @bind] when used with a bindtype
249       of 'columns'
250
251 ----------------------------
252 revision 1.49_02  2009-02-16
253     - added an AST-aware SQL::Abstract::Test library for sql syntax tests
254     - vastly expanded test coverage
255     - support for the { operator => \'...'|\['...', @bind] } syntax
256       allowing to embed arbitrary operators on the LHS
257     - fixed multiple regressions wrt DBIx::Class
258
259 ----------------------------
260 revision 1.49_01  2009-02-11
261     - support for literal SQL through the [$sql, bind] syntax.
262     - added -nest1, -nest2 or -nest_1, -nest_2, ...
263     - optional support for array datatypes
264     - defensive programming : check arguments to functions/methods
265     - fixed bug with global logic of -and/-or (no side-effects any more)
266     - changed logic for distributing an op over arrayrefs
267     - fixed semantics of  _bindtype on array args
268     - dropped the _anoncopy of the %where tree. No longer necessary.
269     - dropped the _modlogic function
270     - Make col => [] and col => {$op => [] } DTRT or die instead of generating
271       broken SQL. Added tests for this.
272     - Added { -desc => 'column' } order by support
273     - Tiny "$_"-related fix for { -desc => 'columns'} order by support
274       tests + docs
275
276 ----------------------------
277 revision 1.20
278 date: 2005/08/18 18:41:58;  author: nwiger;  state: Exp;  lines: +104 -50
279 - added patch from Dan Kubb enabling quote_char and name_sep options
280 - added patch from Andy Grundman to enhance _anoncopy for deep refs
281 ----------------------------
282 revision 1.19
283 date: 2005/04/29 18:20:30;  author: nwiger;  state: Exp;  lines: +34 -20
284 added _anoncopy to prevent destroying original; updated docs
285 ----------------------------
286 revision 1.18
287 date: 2005/03/07 20:14:12;  author: nwiger;  state: Exp;  lines: +201 -65
288 added support for -and, -or, and -nest; see docs for details
289 ----------------------------
290 revision 1.17
291 date: 2004/08/25 20:11:27;  author: nwiger;  state: Exp;  lines: +58 -46
292 added patch from Eric Kolve to iterate over all hashref elements
293 ----------------------------
294 revision 1.16
295 date: 2004/06/10 17:20:01;  author: nwiger;  state: Exp;  lines: +178 -12
296 added bindtype param to allow this to work with Orasuck 9+
297 ----------------------------
298 revision 1.15
299 date: 2003/11/05 23:40:40;  author: nwiger;  state: Exp;  lines: +18 -6
300 several bugfixes, including _convert being applied wrong and
301 the edge case field => { '!=', [qw/this that/] } not working
302 ----------------------------
303 revision 1.14
304 date: 2003/11/04 21:20:33;  author: nwiger;  state: Exp;  lines: +115 -34
305 added patch from Philip Collins, and also added 'convert' option
306 ----------------------------
307 revision 1.13
308 date: 2003/05/21 17:22:29;  author: nwiger;  state: Exp;  lines: +230 -74
309 added "IN" and "BETWEEN" operator support, as well as "NOT"
310 modified where() to support ORDER BY, and fixed some bugs too
311 added PERFORMANCE and FORMBUILDER doc sections
312 fixed several bugs in _recurse_where(), it now works as expected
313 added test suite, many thanks to Chas Owens
314 modified all hash access to return keys sorted, to allow cached queries
315 ----------------------------
316 revision 1.12
317 date: 2003/05/08 20:10:56;  author: nwiger;  state: Exp;  lines: +181 -96
318 1.11 interim checking; major bugfixes and order_by, 1.12 will go to CPAN
319 ----------------------------
320 revision 1.11
321 date: 2003/05/02 00:07:30;  author: nwiger;  state: Exp;  lines: +52 -12
322 many minor enhancements to add querying flexibility
323 ----------------------------
324 revision 1.10
325 date: 2002/09/27 18:06:25;  author: nwiger;  state: Exp;  lines: +6 -2
326 added precatch for messed up where string
327 ----------------------------
328 revision 1.9
329 date: 2002/08/29 18:04:35;  author: nwiger;  state: Exp;  lines: +4 -3
330 CPAN
331 ----------------------------
332 revision 1.8
333 date: 2001/11/07 22:18:12;  author: nwiger;  state: Exp;  lines: +31 -14
334 added embedded SCALAR ref capability to insert() and update()
335 ----------------------------
336 revision 1.7
337 date: 2001/11/07 01:23:28;  author: nwiger;  state: Exp;  lines: +3 -3
338 damn uninit warning
339 ----------------------------
340 revision 1.6
341 date: 2001/11/06 21:09:44;  author: nwiger;  state: Exp;  lines: +14 -6
342 oops, had to actually *implement* the order by for select()!
343 ----------------------------
344 revision 1.5
345 date: 2001/11/06 03:13:16;  author: nwiger;  state: Exp;  lines: +43 -4
346 lots of docs
347 ----------------------------
348 revision 1.4
349 date: 2001/11/06 03:07:42;  author: nwiger;  state: Exp;  lines: +16 -7
350 added extra layer of ()'s to ensure correct semantics on AND
351 ----------------------------
352 revision 1.3
353 date: 2001/11/06 01:16:31;  author: nwiger;  state: Exp;  lines: +11 -10
354 updated all statements so that they use wantarray to just return SQL if asked
355 ----------------------------
356 revision 1.2
357 date: 2001/10/26 22:23:46;  author: nwiger;  state: Exp;  lines: +112 -15
358 added scalar ref for SQL verbatim in where, fixed bugs, array ref, docs
359 ----------------------------
360 revision 1.1
361 date: 2001/10/24 00:26:43;  author: nwiger;  state: Exp;
362 Initial revision