Skip to content

Commit 8a07068

Browse files
Merge branch 'sqlancer:main' into main
2 parents 4a53089 + c55cd50 commit 8a07068

4 files changed

Lines changed: 151 additions & 10 deletions

File tree

_posts/2023-06-04-gsoc-sqlancer.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: "Google Summer of Code (GSoC) 2023"
3+
date: 2023-06-04
4+
categories:
5+
- blog
6+
tags:
7+
- gsoc
8+
---
9+
10+
![alt]({{ site.url }}{{ site.baseurl }}/assets/images/2023-gsoc-contributors.jpg)
11+
12+
For the first time, SQLancer is participating as a [Google Summer of Code (GSoC)](https://summerofcode.withgoogle.com/programs/2023/organizations/sqlancer) organization. We are excited that we will be working with two contributors: [Zhenglin Li](https://github.com/ZhengLin-Li) and [Yutan Yang](https://github.com/ColinYoungTaro). Find out more about them below!
13+
14+
15+
# Yutan Yang
16+
17+
## Could you introduce yourself?
18+
19+
Hello, I'm Yutan Yang, a first-year master's student at Zhejiang University, Hangzhou, China.
20+
I am interested in coding since I find it interesting to bring ideas to life through programming.
21+
Aside from coding, I also enjoy drawing while I may not consider myself an expert.
22+
23+
## What will you be working on as part of your GSoC project?
24+
25+
As part of my GSoC project, I will be working on implementing test case reduction approaches.
26+
27+
SQLancer automatically generates thousands of statements and it might be complicated to identify which is relevant to the bug. The reduction process removes statements and tokens which are irrelevant to bugs so that the test case could be simple and clear. Additionally, I aim to extend these reduction approaches to support more DBMSs.
28+
29+
## How did you hear about GSoC and SQLancer?
30+
31+
I first learned about GSoC through recommendations from one of my friends, and I think contributing to open-source projects is cool.
32+
33+
I came across SQLancer when exploring Program Organizations listed on the GSoC website. Recognizing that the idea is related to my graduate research topic, I decided to apply for it.
34+
35+
## What will you do after the project?
36+
37+
I might keep on contributing to open-source projects. I hope this experience will allow me to gain engineering experience and collaboration skills.
38+
39+
I would first continue my study. After successfully completing my master's degree, I am excited to transition into the professional world and pursue opportunities in the IT industry.
40+
41+
# Zhenglin Li
42+
43+
## Could you introduce yourself?
44+
45+
My name is Zhenglin Li. I am currently a senior year undergraduate student majoring in software engineering at SCU.
46+
I have been accepted for graduate studies at TAMU, starting 23 fall, where I will be specializing in computer science.
47+
I have a strong passion for open source projects. I have actively contributed to several projects, including SQLancer, Casbin, Beam, and so on.
48+
49+
## What will you be working on as part of your GSoC project?
50+
51+
As part of my GSoC project, my primary focus will be on enhancing SQLancer to support a new database system called StoneDB.
52+
This will involve various tasks, such as integrating support for the new DBMS, testing the system, identifying, validating, and reporting bugs or issues found.
53+
54+
## How did you hear about GSoC and SQLancer?
55+
56+
I first learned about the Google Summer of Code program approximately three years ago through a video platform called bilibili. In my opinion, GSoC will provid me with a great opportunity to delve into the world of open source and make valuable contributions under the mentorship of experienced individuals.
57+
58+
In the case of SQLancer, I discovered it while browsing through the list of organizations participating in GSoC. I found SQLancer interesting. Also, SQLancer is useful and it has uncovered numerous bugs in well-established DBMS.
59+
60+
## What will you do after the project?
61+
62+
After completing my GSoC project, my plan is to continue actively contributing to SQLancer and other open source community. I believe in the power of open source software because it is transformative.
63+
64+
Looking ahead, I will be starting my graduate studies at Texas A&M University. The program I am attending is Master of Computer Science. After this, I plan to seek employment in the tech companies, building software that interests me, excites me, and impact people.

_posts/2023-06-4-gsoc-sqlancer.md

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: 'GSoC 2023: Midterm Report on Support of StoneDB by Zhenglin Li'
3+
date: 2023-06-04
4+
categories:
5+
- blog
6+
tags:
7+
- gsoc
8+
---
9+
10+
# Support of StoneDB Midterm Report by Zhenglin Li
11+
12+
SQLancer is an open-source tool for testing the correctness of SQL database systems and supports close to 20 database systems. The goal of this project is to add support for StoneDB to SQLancer and test StoneDB to find potential bugs.
13+
14+
StoneDB is an open-source hybrid transaction/analytical processing (HTAP) database designed and developed by StoneAtom based on the MySQL kernel. It provides features such as high efficiency and real-time analytics, offering a one-stop solution to process online transaction processing (OLTP), online analytical processing (OLAP), and HTAP workloads.
15+
16+
## Things Achieved
17+
18+
See the detailed description of supported syntax here: [Functions Supported by SQLancer for StoneDB](https://docs.google.com/document/d/12OpiDYs_Civor-saKZFmZPZd5ElVJAc9RDpDIwikh9Y/edit?usp=sharing)
19+
20+
See the detailed description of bugs found here: [Bugs Found in StoneDB by SQLancer](https://docs.google.com/document/d/1N-oUGVATV0l6tG87uOtPNmfLS7g_fuo7HIckFobD-Yo/edit?usp=sharing)
21+
22+
## Encountered Challenges and Solutions
23+
24+
This section will cover challenges encountered and the way I addressed them.
25+
26+
### Choose which StoneDB version to support
27+
28+
During the **initial stages** of our project, our plan was to support the **latest version** of StoneDB, which is **version 8.0**.
29+
30+
However, we encountered several challenges that hindered our ability to work with the 8.0 version. Firstly, there was no available Docker image to facilitate the easy execution of the 8.0 version. Additionally, building StoneDB from source code presented difficulties related to missing packages and incompatible versions within the environment.
31+
32+
Considering these obstacles, we made the decision to **prioritize the support for StoneDB version 5.7 initially**. And by the midterm evaluation, we have successfully implemented the basic support of 5.7 version.
33+
34+
Looking ahead, as we **plan to extend our support to the 8.0 version**, we have identified **two potential approaches**.
35+
36+
1. If the **differences** between the 5.7 and 8.0 versions are **minimal**, we can enhance the existing implementation by introducing a **parameter flag** that handles the version-specific variations. This approach allows us to maintain a single unified implementation that can accommodate both versions.
37+
2. If the **differences** between the versions are **large**, we need to **implement separate code paths** for each version, treating them as distinct entities.
38+
39+
### Which generator to use: typed or untyped
40+
41+
Looking at the three files:
42+
43+
- [sqlancer/common/gen/ExpressionGenerator.java](https://github.com/sqlancer/sqlancer/blob/main/src/sqlancer/common/gen/ExpressionGenerator.java)
44+
- [sqlancer/common/gen/TypedExpressionGenerator.java](https://github.com/sqlancer/sqlancer/blob/main/src/sqlancer/common/gen/TypedExpressionGenerator.java)
45+
- [sqlancer/common/gen/UntypedExpressionGenerator.java](https://github.com/sqlancer/sqlancer/blob/main/src/sqlancer/common/gen/UntypedExpressionGenerator.java)
46+
47+
The `ExpressionGenerator` is an interface, and `TypedExpressionGenerator` and `UntypedExpressionGenerator` are abstract classes that implement the `ExpressionGenerator` interface.
48+
49+
When implementing the concrete generator, we have to decide which generator to inherit from, the `TypedExpressionGenerator` or the `UntypedExpressionGenerator`.
50+
51+
A **typed generator** is a generator which is **associated with a specific data type or set of data types**. One characteristic is that it allows for generating values of the type that is expected in a specific context. On the other hand, an **untyped generator** **does not** have a specific data type associated with it. It can yield values of any type.
52+
53+
The choice between using a typed or untyped generator **depends on the requirements of the DBMS under test**. Typed generators provide the advantage of generating expected types when this is important. Untyped generators, on the other hand, offer more **flexibility** and can be useful in scenarios where the type of yielded values may vary or is not known in advance.
54+
55+
Ultimately, I decided to use the untyped generator because it can yield values of any type, allowing us to test the support of unexpected types of a DBMS.
56+
57+
### Read and understand the code of the implementation of other DBMS in SQLancer
58+
59+
During the initial phase of our project, I delved into the codebase of various DBMS implementations within SQLancer to gain a comprehensive understanding.
60+
61+
The first challenge I encountered is due to the limited comments within the code. Consequently, I had to rely on studying the source code to comprehend the design and functionality of classes, methods, and functions. The good news is though the implementation details may differ from one database to another, there are still some common rules to follow. So, I read the code of many other DBMS and identified the common parts and started my implementation.
62+
63+
## Interaction With StoneDB Community
64+
65+
This section will cover our interaction with the StoneDB community.
66+
67+
We actively engaged with the StoneDB community to seek assistance, share our findings, and collaborate on improving the system. Our interaction primarily took place through the **Slack channel** and **GitHub platform**.
68+
69+
In addition to Slack, we also utilized the issue and discussion sections on GitHub to communicate with the StoneDB community. All questions or comments got replies. For example,
70+
71+
- They answered our question here: [stonedb-8.0-v1.0.1-beta](https://github.com/orgs/stoneatom/discussions/1849#discussioncomment-6138954)
72+
- They fixed [the docker size bug](https://github.com/stoneatom/stonedb/issues/1923) we found previously
73+
- They are trying to fix the [bad dpn index when deleting rows bug](https://github.com/stoneatom/stonedb/issues/1933)
74+
- They are trying to fix the [crash: StoneDB crash when executing the command (SELECT, HAING, GROUP BY, IS NULL)](https://github.com/stoneatom/stonedb/issues/1941)
75+
- They are trying to fix the [bug: query result not correct](https://github.com/stoneatom/stonedb/issues/1942)
76+
77+
## Future Work
78+
79+
This section will cover opportunities for potential future changes.
80+
81+
1. Test StoneDB, add more expected errors, and report potential bugs.
82+
83+
2. Support more statement categories and syntax. For example, referring to the docs of MySQL, there are some optional arguments that we may not currently support. We can support them in the future.
84+
85+
3. Another example is that, we can support more functions, refer to: https://stonedb.io/docs/SQL-reference/functions/advanced-functions
86+
87+
4. Refine the code implementation. For example, we can discuss if we can reuse some code that is common to all DBMS implementations.
182 KB
Loading

0 commit comments

Comments
 (0)