Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 647860

Summary: Incorrect detection of data types in address parameters - C++ client
Product: Red Hat Enterprise MRG Reporter: Jonathan Robie <jonathan.robie>
Component: qpid-cppAssignee: Jonathan Robie <jonathan.robie>
Status: CLOSED ERRATA QA Contact: ppecka <ppecka>
Severity: medium Docs Contact:
Priority: low    
Version: DevelopmentCC: gsim, iboverma, jneedle, ppecka, tross
Target Milestone: 1.3.0.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A flaw in the address parser for the C++ messaging client caused numeric arguments for address attributes to be interpreted and encoded as strings. This resulted in problems when passing numeric arguments for queue-creation operations (e.g. setting the size limit, the durable journal file count, etc.). With this update, the parser has been fixed so that numeric text is interpreted as numbers and not strings.
Story Points: ---
Clone Of:
: 652088 (view as bug list) Environment:
Last Closed: 2010-11-30 17:51:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 652088    

Description Jonathan Robie 2010-10-29 17:53:27 UTC
See https://issues.apache.org/jira/browse/QPID-2896.

Comment 1 Gordon Sim 2010-11-01 12:52:08 UTC
*** Bug 641505 has been marked as a duplicate of this bug. ***

Comment 2 Jonathan Robie 2010-11-02 13:57:39 UTC
The C++ client's address parser should recognize integer, floating point, and boolean literals, and create values with the correct datatypes. Before this fix, string values were created.

Consider this address:

"my-topic; {a:bc, x:101, y:'a string'}"

Before this bug fix, the value of x was set to the string "101". With this fix, it is set to an unsigned integer 101.

Bug 647861 covers a related bug in the server, which accepted arguments of the wrong type, but with unexpected behavior.

Comment 4 Jonathan Robie 2010-11-05 20:56:16 UTC
Cherry picked into:

mrg_1.3.x
ad49d2056942c8d44ebf2102d089fa9c4b9e5252

Comment 5 Ted Ross 2010-11-10 02:59:49 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: A defect in the address parser for the C++ messaging client.

Consequence: Numeric arguments for address attributes are interpreted an encoded as strings.  This causes problems when passing numeric arguments for queue-creation (i.e. setting the size limit or the durable journal file count).  Such strings are misinterpreted by the broker when creating the queue.

Fix: The parser was fixed such that numeric text is interpreted as numbers and not strings.

Result: Numeric arguments in addresses can be used and properly interpreted by the broker.

Comment 7 ppecka 2010-11-10 16:31:11 UTC
Verified on RHEL( 4.8 | 5.5 ) && ( i386 | x86_64 )

tested with
./drain "my-queue;{create:always,node:{type:queue,x-declare:{arguments:{'qpid.max_count':60}}}}"
qpid-config queues 


# rpm -qa | grep qpid | sort
python-qpid-0.7.946106-14.el5
qpid-cpp-client-0.7.946106-19.el5
qpid-cpp-client-devel-0.7.946106-19.el5
qpid-cpp-client-devel-docs-0.7.946106-19.el5
qpid-cpp-client-ssl-0.7.946106-19.el5
qpid-cpp-mrg-debuginfo-0.7.946106-19.el5
qpid-cpp-server-0.7.946106-19.el5
qpid-cpp-server-cluster-0.7.946106-19.el5
qpid-cpp-server-devel-0.7.946106-19.el5
qpid-cpp-server-ssl-0.7.946106-19.el5
qpid-cpp-server-store-0.7.946106-19.el5
qpid-cpp-server-xml-0.7.946106-19.el5
qpid-java-client-0.7.946106-11.el5
qpid-java-common-0.7.946106-11.el5
qpid-java-example-0.7.946106-11.el5
qpid-tools-0.7.946106-11.el5

--> VERIFIED

Comment 9 errata-xmlrpc 2010-11-30 17:51:08 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0921.html

Comment 10 Martin Prpič 2010-12-01 14:52:05 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1 @@
-Cause: A defect in the address parser for the C++ messaging client.
+A flaw in the address parser for the C++ messaging client caused numeric arguments for address attributes to be interpreted and encoded as strings. This resulted in problems when passing numeric arguments for queue-creation operations (e.g. setting the size limit, the durable journal file count, etc.). With this update, the parser has been fixed so that numeric text is interpreted as numbers and not strings.-
-Consequence: Numeric arguments for address attributes are interpreted an encoded as strings.  This causes problems when passing numeric arguments for queue-creation (i.e. setting the size limit or the durable journal file count).  Such strings are misinterpreted by the broker when creating the queue.
-
-Fix: The parser was fixed such that numeric text is interpreted as numbers and not strings.
-
-Result: Numeric arguments in addresses can be used and properly interpreted by the broker.