chernishev / toydbms-old Goto Github PK
View Code? Open in Web Editor NEWToy DBMS for students of Saint-Petersburg Academic University
License: GNU General Public License v3.0
Toy DBMS for students of Saint-Petersburg Academic University
License: GNU General Public License v3.0
The following code makes no sense:
std::ptrdiff_t lpos1 = std::find(ln[i].begin(), ln[i].end(), ((LJoinNode*)prototype)->offset1) - ln[i].begin();
std::ptrdiff_t lpos2 = std::find(ln[i].begin(), ln[i].end(), ((LJoinNode*)prototype)->offset2) - ln[i].begin();
if (lpos1 <= ln.size() || lpos1 <= ln.size()) {
if (lpos1 < lpos2)
lpos = lpos1;
else
lpos = lpos2;
break;
}
For instance, the condition in the first if
compares index in ln[i]
with size of ln
, which is meaningless. Also, lpos
is assigned an index from ln[i]
and it's later used as a column id, which makes no sense as well.
Example where this does not work: just make id
column in table
the last column and run demo
Assuming that fieldOrders
vector should contain invariant about order of rows corresponding to that field, LJoinNode
initiates it incorrectly: it assumes that all non-joined columns remain sorted in the same way as they were. However, it's clearly not the case, e.g. if we join these two tables on column A
:
| A | B |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| A | C |
| 3 | 1 |
| 1 | 2 |
| 3 | 3 |
After join, column C
will become unsorted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.