Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

GetVarcharValue.ToString lost the last character #332

Closed
eric-haibin-lin opened this issue Nov 3, 2016 · 0 comments
Closed

GetVarcharValue.ToString lost the last character #332

eric-haibin-lin opened this issue Nov 3, 2016 · 0 comments

Comments

@eric-haibin-lin
Copy link
Member

eric-haibin-lin commented Nov 3, 2016

This test will fail:

common::Value v9 = common::ValueFactory::GetVarcharValue("hello");
EXPECT_EQ(v9.ToString(), "hello");

v9.ToString() returns "hell".
Because GetVarcharValue didn't count the \0 at the end, while ToString considers the last character to be \0.

https://github.com/cmu-db/peloton/blob/master/src/include/common/value_factory.h#L61
https://github.com/cmu-db/peloton/blob/master/src/common/varlen_type.cpp#L139

eric-haibin-lin added a commit to eric-haibin-lin/peloton-1 that referenced this issue Nov 3, 2016
eric-haibin-lin added a commit to eric-haibin-lin/peloton-1 that referenced this issue Nov 3, 2016
linmagit added a commit that referenced this issue Nov 3, 2016
eric-haibin-lin added a commit to eric-haibin-lin/peloton-1 that referenced this issue Nov 4, 2016
17zhangw added a commit to 17zhangw/peloton that referenced this issue Apr 5, 2019
What still doesn't work/don't care about yet/not done
- proper memory management (terrier uses shared_ptr anyways)

- other 1-level rewrites, multi-layer rewrites, other expr rewrites

- how can we define a grammar to programmatically create these rewrites?
  (the one we have is way too static...)

- in relation to logical equivalence:
  (1) how do we generate logically equivalent expressions:
      - multi-pass using generating rules (similar to ApplyRule) OR
      - from Pattern A, generate logically equivalent set of patterns P OR
      - transform input expression to match certain specification OR
      - ???
  (2) what operators do we support translating?
      - probably (a AND b) ====> (b AND a)
      - probably (a OR b) ====> (b OR a)
      - probably (a = b) ====> (b = a)
      - maybe more???
  (3) do we want multi level translations?
      - i.e (a AND b) AND c ====> (a AND (b AND c))
      - what order do we do these in?
  May have to modify these operations:
  - Some assertions in TopDownRewrite/BottomUpRewrite w.r.t to the iterator
  - Possibly binding.cpp / optimizer_metadata.h / optimizer_task.cpp

Issues still pending:
- Comparing Values (Matt email/discussion)
- r.rule->Check (terrier issue cmu-db#332)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant