Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: bugs

[Bug 1445] Unable to view diff from checked out story

 

 

Bricolage bugs RSS feed   Index | Next | Previous | View Threaded


bugs at lists

Mar 9, 2009, 3:59 PM

Post #1 of 12 (1559 views)
Permalink
[Bug 1445] Unable to view diff from checked out story

http://bugs.bricolage.cc/show_bug.cgi?id=1445


David Wheeler <david [at] kineticode> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |david [at] kineticode
AssignedTo|bugs [at] lists |david [at] kineticode




--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 9, 2009, 4:02 PM

Post #2 of 12 (1493 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445


David Wheeler <david [at] kineticode> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED




--- Comment #1 from David Wheeler <david [at] kineticode> 2009-03-09 23:02:03 ---
This look suspiciously like Bug # 1427. Do you still have this issue with that
patch applied?


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 9, 2009, 4:08 PM

Post #3 of 12 (1494 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #2 from David Wheeler <david [at] kineticode> 2009-03-09 23:08:32 ---
I can see that you've applied the patch, but it is in fact the same bug. Still
trying to figure out how it could possibly say "LIMIT LIMIT", which is the
source of the problem.


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 9, 2009, 4:33 PM

Post #4 of 12 (1506 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #3 from David Wheeler <david [at] kineticode> 2009-03-09 23:33:20 ---
I can't replicate this, and can't see how it'd happening. Can you try this?

Index: lib/Bric/Util/Event.pm
===================================================================
--- lib/Bric/Util/Event.pm (revision 8475)
+++ lib/Bric/Util/Event.pm (working copy)
@@ -1466,6 +1466,7 @@
: (\$SEL_COLS, $order_by)
;

+ print STDERR "'$limit'\n";
my $sel = prepare_c(qq{
SELECT $$qry_cols
FROM $tables

Then restart Bricolage and tail your error log as you make this happen again
and paste the results here.

Thanks!


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 9, 2009, 5:13 PM

Post #5 of 12 (1499 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #4 from Adam Wilson <adam [at] rfx-tech> 2009-03-10 00:13:00 ---
(In reply to comment #3)
> I can't replicate this, and can't see how it'd happening. Can you try this?
>
> Index: lib/Bric/Util/Event.pm
> ===================================================================
> --- lib/Bric/Util/Event.pm (revision 8475)
> +++ lib/Bric/Util/Event.pm (working copy)
> @@ -1466,6 +1466,7 @@
> : (\$SEL_COLS, $order_by)
> ;
>
> + print STDERR "'$limit'\n";
> my $sel = prepare_c(qq{
> SELECT $$qry_cols
> FROM $tables
>
> Then restart Bricolage and tail your error log as you make this happen again
> and paste the results here.
>
> Thanks!
>

'LIMIT LIMIT ?'
[Tue Mar 10 00:11:56 2009] [error] [client 172.16.12.196] Unable to execute SQL
statement: DBD::Pg::st execute failed: ERROR: syntax error at or near "LIMIT"
at character 528\n [for Statement "\n SELECT e.id, t.id, e.usr__id,
e.obj_id, e.timestamp, t.key_name, t.name, t.description, c.pkg_name, CASE WHEN
e.id IN (SELECT event__id FROM alert) THEN 1 ELSE 0 END, ta.name, ea.value\n
FROM event e LEFT JOIN event_attr ea ON e.id = ea.event__id LEFT JOIN
event_type_attr ta ON ea.event_type_attr__id = ta.id, class c, event_type t\n
WHERE e.event_type__id = t.id AND t.class__id = c.id AND e.obj_id = ? AND
LOWER(t.key_name) LIKE LOWER(?)\n ORDER BY e.timestamp DESC, e.id DESC\n
LIMIT LIMIT ? ;\n " with ParamValues: 1='1149', 3='1',
2='story_save'] at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 1136, <GEN11>
line 378.\n\nStack:\n [/usr/local/bricolage/lib/Bric/Util/DBI.pm:1136]\n
[/usr/local/bricolage/lib/Bric/Util/Event.pm:1481]\n
[/usr/local/bricolage/lib/Bric/Util/Event.pm:388]\n
[/usr/local/bricolage/comp/widgets/story_prof/story_prof.mc:115]\n
[/usr/local/bricolage/comp/workflow/profile/story/dhandler:32]\n
[/usr/local/bricolage/comp/autohandler:7]\n
[/usr/local/bricolage/lib/Bric/Util/DBI.pm:1137]
[/usr/local/bricolage/lib/Bric/Util/Event.pm:1481]
[/usr/local/bricolage/lib/Bric/Util/Event.pm:388]
[/usr/local/bricolage/comp/widgets/story_prof/story_prof.mc:115]
[/usr/share/perl5/HTML/Mason/Component.pm:135]
[/usr/share/perl5/HTML/Mason/Request.pm:1284]
[/usr/share/perl5/HTML/Mason/Request.pm:1332]
[/usr/local/bricolage/comp/workflow/profile/story/dhandler:32]
[/usr/share/perl5/HTML/Mason/Component.pm:135]
[/usr/share/perl5/HTML/Mason/Request.pm:1284]
[/usr/share/perl5/HTML/Mason/Request.pm:943]
[/usr/local/bricolage/comp/autohandler:7]
[/usr/share/perl5/HTML/Mason/Component.pm:135]
[/usr/share/perl5/HTML/Mason/Request.pm:1279]
[/usr/share/perl5/HTML/Mason/Request.pm:473]
[/usr/share/perl5/HTML/Mason/ApacheHandler.pm:168]
[/usr/share/perl5/HTML/Mason/ApacheHandler.pm:825]
[/usr/local/bricolage/lib/Bric/App/Handler.pm:309]


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 9, 2009, 7:25 PM

Post #6 of 12 (1514 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #5 from David Wheeler <david [at] kineticode> 2009-03-10 02:25:13 ---
(In reply to comment #4)

> 'LIMIT LIMIT ?'
> [Tue Mar 10 00:11:56 2009] [error] [client 172.16.12.196] Unable to execute SQL
> statement: DBD::Pg::st execute failed: ERROR: syntax error at or near "LIMIT"

Okay, I don't get this *at all*. What version of Perl is this? Is it a
vendor-distributed Perl (e.g., Debian) or did you compile from source?

What I don't get is that the sole use of $limit is:

my $limit = '';
if (exists $params->{Limit}) {
push @limits, delete $params->{Limit};
$limit = 'LIMIT ?';
}


That's it. I can't for the life of me figure out where the hell it's getting
screwed up. I mean, can *you* see anywhere in that subroutine (`$get_em = sub
{` in lib/Bric/Util/Event.pm) where it would bet getting an extra "LIMIT" stuck
in the string? Because I can't. This is totally bizarre.

Are you loading anything funky in PERL_LOADER, perhaps?


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 10, 2009, 3:28 AM

Post #7 of 12 (1493 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445


Scott Lanning <lannings [at] who> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |lannings [at] who




--- Comment #6 from Scott Lanning <lannings [at] who> 2009-03-10 10:28:01 ---
Adam, please copy/paste $get_em (or add an attachment) here.
Also make sure that you're editing the right file
(is it possibly installed in multiple places?).
And of course restart the server.


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 12, 2009, 8:08 AM

Post #8 of 12 (1476 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #7 from Adam Wilson <adam [at] rfx-tech> 2009-03-12 15:08:12 ---
Created an attachment (id=361)
--> (http://bugs.bricolage.cc/attachment.cgi?id=361)
my Event.pm with previous patch.


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 12, 2009, 8:08 AM

Post #9 of 12 (1473 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #8 from Adam Wilson <adam [at] rfx-tech> 2009-03-12 15:08:23 ---
(In reply to comment #6)
> Adam, please copy/paste $get_em (or add an attachment) here.
> Also make sure that you're editing the right file
> (is it possibly installed in multiple places?).
> And of course restart the server.
>

So, here is where the problem is arising, (I think).
I am dealing with lib/Bric/Util/Event.pm from 1.11.1.
Attachment 360; it does not appear to have been designed to be patched against
that version of Bricolage so you applied it manually. The result of the manual
application of the patch:

(/usr/local/bricolage/lib/Bric/Util/Event.pm)
1409 # $limit = LIMIT_DEFAULT if (exists $params->{Offset});
1410 my $limit = '';
1411 if ($params->{Limit}) {
1412 push @limits, delete $params->{Limit};
1413 $limit = ' LIMIT ?';
1414 }
1415 my $offset = '';
1416 if ($params->{Offset}) {
1417 push @limits, delete $params->{Offset};
1418 $offset = ' OFFSET ?';
1419 }
1420 $limit = 'LIMIT ' . $limit if $limit ne '';


Line 1420 seem to be what is causing "LIMIT LIMIT" to appear. I don't know why
that line is in the 1.11.1 version, and would be happy to remove it if anyone
feels that I should.

Line 1409 was also there, and I commented it out cause it was not working in
conjunction with the patch.


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 12, 2009, 8:40 AM

Post #10 of 12 (1485 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #9 from David Wheeler <david [at] kineticode> 2009-03-12 15:40:48 ---
(In reply to comment #8)

> Line 1420 seem to be what is causing "LIMIT LIMIT" to appear. I don't know why
> that line is in the 1.11.1 version, and would be happy to remove it if anyone
> feels that I should.

Oh, hells yah! That's the problem.

> Line 1409 was also there, and I commented it out cause it was not working in
> conjunction with the patch.

Yeah, You should make that whole section into this:

my $limit = '';
if (exists $params->{Limit}) {
push @limits, delete $params->{Limit};
$limit = 'LIMIT ?';
}
my $offset = '';
if (exists $params->{Offset}) {
if (DBD_TYPE eq 'mysql' && !$limit) {
# Fuck you, MySQL.
push @limits, LIMIT_DEFAULT;
$limit = 'LIMIT ?';
}
push @limits, delete $params->{Offset};
$offset = 'OFFSET ?';
}


Thanks,

David


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 12, 2009, 8:52 AM

Post #11 of 12 (1473 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445





--- Comment #10 from Adam Wilson <adam [at] rfx-tech> 2009-03-12 15:52:57 ---
> Yeah, You should make that whole section into this:
>
> my $limit = '';
> if (exists $params->{Limit}) {
> push @limits, delete $params->{Limit};
> $limit = 'LIMIT ?';
> }
> my $offset = '';
> if (exists $params->{Offset}) {
> if (DBD_TYPE eq 'mysql' && !$limit) {
> # Fuck you, MySQL.
> push @limits, LIMIT_DEFAULT;
> $limit = 'LIMIT ?';
> }
> push @limits, delete $params->{Offset};
> $offset = 'OFFSET ?';
> }
>

While the MySQL sentiments may be accurate, I removed them from my build.
Since I am not using MySQL I cannot attest the effectiveness of those
additional lines of code, but otherwise it all works for me now.


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


bugs at lists

Mar 12, 2009, 9:04 AM

Post #12 of 12 (1478 views)
Permalink
[Bug 1445] Unable to view diff from checked out story [In reply to]

http://bugs.bricolage.cc/show_bug.cgi?id=1445


David Wheeler <david [at] kineticode> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED




--- Comment #11 from David Wheeler <david [at] kineticode> 2009-03-12 16:04:34 ---
Excellent, glad we figured this out. Thanks for suggesting that Adam post his
code, Scott!


--
Configure bugmail: http://bugs.bricolage.cc/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

Bricolage bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.