WL#5082: Value register implementation
Affects: Server-Prototype Only — Status: In-Design — Priority: Medium
As described in WL#4904, the goal is to introduce a Value object that can represent a value of any type used in SQL expressions. WL#4760 designed and prototyped a version based on immutable value objects. As explained in WL#4904, this approach had some issues that lead us to believe that a design based on "Value registers" are more appropriate. Instead of passing around immutable values, we will pass around a reference to a storage location for a piece of data, i.e. similar to the concept of a computer register. For example, Item could in order to evaluate an expression provide a method "Item::eval(Register*)", and store the result of the evaluation in the register provided by the caller. The Value register will provide a centralized API to access and convert a single value (data) of SQL expressions. That is, a Value register may store a value of any SQL type. Associated with the register will be a metadata object that provide the necessary type information for the value. (Ref. WL#5081). Based on the requirements given in WL#4904, a Value register should provide: 1. Construction of a value for a parser constant - avoiding extra copying, if possible. E.g., "SELECT "long text"; (Req 1 in HLS of WL#4904) 2. A central location for type data conversion functionality. This functionality should be accessed through an API. (Req 6) 3. Conversion of a Value to int, char, string, etc. (Req 8)
Copyright (c) 2000, 2018, Oracle Corporation and/or its affiliates. All rights reserved.