Commit cbbc4ac
committed
fix(plpgsql-deparser): handle = assignment operator in splitAssignment
PL/pgSQL allows both := and = for assignments. Previously, splitAssignment()
only recognized :=, causing = assignments to fail hydration and become
kind: 'raw' without valueExpr/targetExpr. This prevented AST-based
transformations (like schema renaming) from working on = assignments.
This fix:
- Adds = as a valid assignment operator in splitAssignment()
- Avoids false positives from comparison operators (>=, <=, <>, !=)
- Avoids false positives from => (named parameter syntax)
- Adds test case for = assignment hydration1 parent 3b3beb1 commit cbbc4ac
File tree
2 files changed
+78
-6
lines changed- packages/plpgsql-deparser
- __tests__
- src
2 files changed
+78
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
53 | 83 | | |
54 | 84 | | |
55 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| |||
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
332 | 354 | | |
333 | 355 | | |
334 | 356 | | |
| |||
343 | 365 | | |
344 | 366 | | |
345 | 367 | | |
| 368 | + | |
346 | 369 | | |
347 | | - | |
348 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
349 | 374 | | |
350 | | - | |
351 | | - | |
352 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
353 | 395 | | |
354 | 396 | | |
355 | 397 | | |
| |||
0 commit comments