-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: create view using the date func (DATE_ADD|DATE_SUB) in the where statement, query fails #342
Comments
@gougexuanli , Can you describe the root cause of this crash? If yes, please, list the root cause here. |
Okay, The reason I found so far is that Date operation function returns a value of type Item::CACHE_ITEM, but the MysqlExpression-related functions (MysqlExpression::SanityAggregationCheck, MysqlExpression::TransformTree) do not handle this type, resulting in this error |
Why the return type of function The DATE_ADD function: defintion as following: |
@RingsC
this will gen a CACHE_ITEM type, resulting in this error. |
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(mtr):mtr result stonedb change to tianmu(stoneatom#359) (stoneatom#368) * fix(mtr):mysqlpump*.test sys_stoendb to sys_tianmu fix(mtr):fix main result stonedb to tianmu fix(mtr):mv innodb_fts.ngram_1 to test/innodb_fts fix(mtr):fix mtr funcs_1 stonedb to tianmu fix(mtr):fix innodb mtr result stonedb change to tianmu fix(mtr):fix perfschema mtr result stonedb change to tianmu * fix(mtr):fix mtr stoendb change to tianmu Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(tianmu): fix group_concat_max_len warning (stoneatom#338) (stoneatom#363) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> docs(stonedb): update docs and fix bugs (stoneatom#373) * docs(Quick Deployment and Compiling Methods): update docs Make the document more user-friendly for new users * fix(docs): Let the official website pictures can be adaptive * Update compile-using-ubuntu2004.md In the install make step, add the go to directory:cd make-3.82 * Update compile-using-redhat7.md In the install make step, add the go to directory:cd make-3.82 * Update compile-using-centos7.md In the install make step, add the go to directory:cd make-3.82 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: haitaoguan <[email protected]> feat(doc):doc add innodb backup to stonedb demonstrate(stoneatom#353) (stoneatom#355) * feat(doc):doc add innodb backup to stonedb demonstrate * fix(doc):fix mydumper and mysqldump doc Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> feat(innodb): To support compiling innodb as C++ 17(stoneatom#375) (stoneatom#376) To support innodb is compiled as C++ 17. For now, tianmu is compiling as C++17, and C++17 has became mainstream of C++ standard. Therefore, now, we star to support to compile Innodb as C++17 in stonedb. This is backport from MySQL, which commit id is: 1a8a111d8f855a31d0aeffc8f02309b2b82dd410 and bug# is #32907274 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix stonedb for optimize exists subquery and deep memory copy stoneatom#369 (stoneatom#330, stoneatom#329, stoneatom#340, stoneatom#332) (stoneatom#369) * fix stonedb for optimize exists subquery and deep memcopy copy * Update parameterized_filter.cpp fix ParameterizedFilter deep copy mind memory leak * fix subquery when this is in sql * fix code readability and defensive * use shallow memory when paral hash join by class DimensionGroupMultiMaterialized Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> feat(stonedb): To support gcc 9 and adds `WITH_ROCKSDB` and `WITH_MARISA` to specify where (stoneatom#377) rocksdb and marisa installed, respectively. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(mtr): Add test cases for NULL value select on UNIQUE constraint(stoneatom#281) (stoneatom#379) * fix(core): Double prepare on lex unit for cts with union(stoneatom#226) fix(core): MTR + Double prepare on lex unit for ctas with union(stoneatom#226) * fix(mtr): Add test cases for NULL value select on UNIQUE constraint(stoneatom#281) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix bug stoneatom#342 (stoneatom#346) Co-authored-by: dfx <duanfuxiang> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Doc(stonedb): Added extensions deccriptions in topics related to backup and recovery for O&M Guide(stoneatom#360) (stoneatom#361) * updated some code snippets in Install RocksDB step Signed-off-by: xuejiao-joy <[email protected]> * some description here Signed-off-by: xuejiao-joy <[email protected]> Co-authored-by: Yuting <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(mtr): Add more ctas queries for the same bug-fix from code-analysis perspectives(stoneatom#226)
fix(core): MTR + Double prepare on lex unit for ctas with union(stoneatom#226) rich doc to fix env dependence "not found" (stoneatom#316) fix(mtr): make the mtr passed (stoneatom#315) (stoneatom#317) [summary] How to run: ./mysql-test-run.pl --suite=stonedb --nowarnings --force --nocheck-testcases 1. test cases below are failed, we ignored them first: issue410 issue415 issue433 issue446 issue515 load.test 2. Sys variables next are not set correctly, they should be added to `/mysql-test/include/default_mysqld.cnf`. stonedb_insert_delayed = 0 stonedb_ini_allowmysqlquerypath=1 3.check-testcases: A new MTR option to enforce strict cleanup: https://dev.mysql.com/blog-archive/fail-check-testcases-a-new-mtr-option-to-enforce-strict-cleanup In `mtr` comment: ``` Some options that control enabling a feature for normal test runs, can be turned off by prepending 'no' to the option, e.g. --notimer. This applies to reorder, timer, check-testcases and warnings. ``` Currently we turn off it first to make mtr run success. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> feat(stonedb): update the copyright date time (stoneatom#321) (stoneatom#324) fix(core): fix crash when executing sql. (stoneatom#327) (stoneatom#328) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> feat(index): Unified class member variable name with google style (stoneatom#311) (stoneatom#312) [summary] Class member name will be like: class TableInfo { ... private: std::string table_name_; // OK - underscore at end. static Pool<TableInfo>* pool_; // OK. }; Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(mtr):move character_set to test.character_set, fix main mtr_test and innodb mtr_test(stoneatom#277) (stoneatom#335) * fix(mtr):fix innodb mtr and mv some test to test/innodb * fix(mtr):move character_set to test/main/ fix(mtr):mv main mtr character_set test to test/main/cahracter_set fix(mtr):mv myisam error mtr-test to test/main/myisam fix(mtr):add optimizer_switch to include/default_mysqld.cnf * fix(mtr):fix main mtr optimizer_switch amd mv some test to test/main Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(mtr): Add more ctas queries for the same bug-fix from code-analysis perspectives(stoneatom#226) fix bugs of stoneatom#309 and stoneatom#310 (stoneatom#313) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(core): Double prepare on lex unit for cts with union(stoneatom#226) (stoneatom#365) fix(core): MTR + Double prepare on lex unit for ctas with union(stoneatom#226) fix(mtr):mtr result stonedb change to tianmu(stoneatom#359) (stoneatom#368) * fix(mtr):mysqlpump*.test sys_stoendb to sys_tianmu fix(mtr):fix main result stonedb to tianmu fix(mtr):mv innodb_fts.ngram_1 to test/innodb_fts fix(mtr):fix mtr funcs_1 stonedb to tianmu fix(mtr):fix innodb mtr result stonedb change to tianmu fix(mtr):fix perfschema mtr result stonedb change to tianmu * fix(mtr):fix mtr stoendb change to tianmu Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(tianmu): fix group_concat_max_len warning (stoneatom#338) (stoneatom#363) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> docs(stonedb): update docs and fix bugs (stoneatom#373) * docs(Quick Deployment and Compiling Methods): update docs Make the document more user-friendly for new users * fix(docs): Let the official website pictures can be adaptive * Update compile-using-ubuntu2004.md In the install make step, add the go to directory:cd make-3.82 * Update compile-using-redhat7.md In the install make step, add the go to directory:cd make-3.82 * Update compile-using-centos7.md In the install make step, add the go to directory:cd make-3.82 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: haitaoguan <[email protected]> feat(doc):doc add innodb backup to stonedb demonstrate(stoneatom#353) (stoneatom#355) * feat(doc):doc add innodb backup to stonedb demonstrate * fix(doc):fix mydumper and mysqldump doc Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> feat(innodb): To support compiling innodb as C++ 17(stoneatom#375) (stoneatom#376) To support innodb is compiled as C++ 17. For now, tianmu is compiling as C++17, and C++17 has became mainstream of C++ standard. Therefore, now, we star to support to compile Innodb as C++17 in stonedb. This is backport from MySQL, which commit id is: 1a8a111d8f855a31d0aeffc8f02309b2b82dd410 and bug# is #32907274 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix stonedb for optimize exists subquery and deep memory copy stoneatom#369 (stoneatom#330, stoneatom#329, stoneatom#340, stoneatom#332) (stoneatom#369) * fix stonedb for optimize exists subquery and deep memcopy copy * Update parameterized_filter.cpp fix ParameterizedFilter deep copy mind memory leak * fix subquery when this is in sql * fix code readability and defensive * use shallow memory when paral hash join by class DimensionGroupMultiMaterialized Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> feat(stonedb): To support gcc 9 and adds `WITH_ROCKSDB` and `WITH_MARISA` to specify where (stoneatom#377) rocksdb and marisa installed, respectively. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(mtr): Add test cases for NULL value select on UNIQUE constraint(stoneatom#281) (stoneatom#379) * fix(core): Double prepare on lex unit for cts with union(stoneatom#226) fix(core): MTR + Double prepare on lex unit for ctas with union(stoneatom#226) * fix(mtr): Add test cases for NULL value select on UNIQUE constraint(stoneatom#281) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix bug stoneatom#342 (stoneatom#346) Co-authored-by: dfx <duanfuxiang> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Doc(stonedb): Added extensions deccriptions in topics related to backup and recovery for O&M Guide(stoneatom#360) (stoneatom#361) * updated some code snippets in Install RocksDB step Signed-off-by: xuejiao-joy <[email protected]> * some description here Signed-off-by: xuejiao-joy <[email protected]> Co-authored-by: Yuting <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> fix(mtr): Add more ctas queries for the same bug-fix from code-analysis perspectives(stoneatom#226)
Describe the problem
Create a view WHERE conditions using date-related functions (such as DATE_ADD, DATE_SUB) can not be queried after the operation, where conditions using other functions such as left function can be queried normally, only the use of date-related functions on WHERE will not be queried, select does not affect the use of fields after the display, you need to have both using VIEW, related functions (such as DATE_ADD, DATE_SUB) after WHERE to cause this.
CREATE TABLE
lineitem
(l_orderkey
int(11) NOT NULL,l_partkey
int(11) NOT NULL,l_suppkey
int(11) NOT NULL,l_linenumber
int(11) NOT NULL,l_quantity
decimal(15,2) NOT NULL,l_extendedprice
decimal(15,2) NOT NULL,l_discount
decimal(15,2) NOT NULL,l_tax
decimal(15,2) NOT NULL,l_returnflag
char(1) NOT NULL,l_linestatus
char(1) NOT NULL,l_shipdate
date NOT NULL,l_commitdate
date NOT NULL,l_receiptdate
date NOT NULL,l_shipinstruct
char(25) NOT NULL,l_shipmode
char(10) NOT NULL,l_comment
varchar(44) NOT NULL,PRIMARY KEY (
l_orderkey
,l_linenumber
)) ENGINE=STONEDB;
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(842980, 1881559, 56614, 4, 5.00, 7702.30, 0.01, 0.03, 'A', 'F', '1992-01-02', '1992-03-20', '1992-01-20', 'COLLECT COD', 'REG AIR', 'lly regular asymptotes. unu');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(1111877, 1341765, 16805, 3, 20.00, 36134.00, 0.10, 0.07, 'A', 'F', '1992-01-02', '1992-02-28', '1992-01-07', 'TAKE BACK RETURN', 'FOB', 're. ideas wake');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(1332613, 539811, 14827, 1, 14.00, 25911.06, 0.08, 0.07, 'A', 'F', '1992-01-02', '1992-02-11', '1992-01-18', 'TAKE BACK RETURN', 'TRUCK', 'y against the furiously regular');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(2184032, 1394196, 44223, 5, 14.00, 18061.82, 0.06, 0.02, 'A', 'F', '1992-01-02', '1992-02-25', '1992-01-15', 'DELIVER IN PERSON', 'RAIL', 'even ideas breach slyly above the d');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(5018977, 820387, 20388, 1, 20.00, 26146.80, 0.00, 0.00, 'A', 'F', '1992-01-02', '1992-03-19', '1992-01-15', 'NONE', 'SHIP', 'packages detect furiously quick');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(8478693, 842913, 92930, 5, 13.00, 24126.31, 0.01, 0.03, 'A', 'F', '1992-01-02', '1992-02-02', '1992-01-05', 'DELIVER IN PERSON', 'REG AIR', 'y silent decoys');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(9838337, 201251, 26254, 1, 10.00, 11522.40, 0.03, 0.05, 'A', 'F', '1992-01-02', '1992-03-27', '1992-01-22', 'NONE', 'RAIL', 'pending pinto beans. boldly unusual de');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(11174723, 851066, 76075, 1, 41.00, 41697.82, 0.07, 0.02, 'A', 'F', '1992-01-02', '1992-03-28', '1992-01-08', 'NONE', 'MAIL', 's detect blithely entic');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(12493984, 912626, 87654, 4, 6.00, 9831.48, 0.02, 0.08, 'A', 'F', '1992-01-02', '1992-02-13', '1992-01-29', 'TAKE BACK RETURN', 'REG AIR', 'e the slyly e');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(12575687, 330833, 30834, 4, 41.00, 76416.62, 0.02, 0.04, 'A', 'F', '1992-01-02', '1992-03-10', '1992-01-28', 'DELIVER IN PERSON', 'RAIL', 'ecial frets. carefully sly depo');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(12753441, 1023833, 98864, 4, 35.00, 61487.30, 0.10, 0.08, 'A', 'F', '1992-01-02', '1992-02-18', '1992-01-23', 'COLLECT COD', 'FOB', 'encies haggle. regular, r');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(15413986, 1799270, 99271, 4, 14.00, 19168.66, 0.05, 0.05, 'A', 'F', '1992-01-02', '1992-01-31', '1992-01-04', 'COLLECT COD', 'TRUCK', 'structions. blithely pending asymptotes');
CREATE VIEW revenue0 AS
SELECT
l_suppkey AS supplier_no,
sum(l_extendedprice * (1 - l_discount)) AS total_revenue
FROM
lineitem
WHERE
l_shipdate >= '1992-01-01'
AND l_shipdate < DATE_ADD('1992-01-01',INTERVAL 3 MONTH)
GROUP BY
l_suppkey;
SELECT * from revenue0;
##The error results are as follows
[HY000]: The query includes syntax that is not supported by the storage engine. Either restructure the query with supported syntax, or enable the MySQL Query Path in config file to execute the query with reduced performance.
Expected behavior
mysql> select * from revenue0 order by supplier_no;
+-------------+---------------+
| supplier_no | total_revenue |
+-------------+---------------+
| 14827 | 23838.1752 |
| 16805 | 32520.6000 |
| 20388 | 26146.8000 |
| 26254 | 11176.7280 |
| 30834 | 74888.2876 |
| 44223 | 16978.1108 |
| 56614 | 7625.2770 |
| 76075 | 38778.9726 |
| 87654 | 9634.8504 |
| 92930 | 23885.0469 |
| 98864 | 55338.5700 |
| 99271 | 18210.2270 |
+-------------+---------------+
12 rows in set (0.00 sec)
How To Reproduce
CREATE TABLE
lineitem
(l_orderkey
int(11) NOT NULL,l_partkey
int(11) NOT NULL,l_suppkey
int(11) NOT NULL,l_linenumber
int(11) NOT NULL,l_quantity
decimal(15,2) NOT NULL,l_extendedprice
decimal(15,2) NOT NULL,l_discount
decimal(15,2) NOT NULL,l_tax
decimal(15,2) NOT NULL,l_returnflag
char(1) NOT NULL,l_linestatus
char(1) NOT NULL,l_shipdate
date NOT NULL,l_commitdate
date NOT NULL,l_receiptdate
date NOT NULL,l_shipinstruct
char(25) NOT NULL,l_shipmode
char(10) NOT NULL,l_comment
varchar(44) NOT NULL,PRIMARY KEY (
l_orderkey
,l_linenumber
)) ENGINE=STONEDB;
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(842980, 1881559, 56614, 4, 5.00, 7702.30, 0.01, 0.03, 'A', 'F', '1992-01-02', '1992-03-20', '1992-01-20', 'COLLECT COD', 'REG AIR', 'lly regular asymptotes. unu');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(1111877, 1341765, 16805, 3, 20.00, 36134.00, 0.10, 0.07, 'A', 'F', '1992-01-02', '1992-02-28', '1992-01-07', 'TAKE BACK RETURN', 'FOB', 're. ideas wake');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(1332613, 539811, 14827, 1, 14.00, 25911.06, 0.08, 0.07, 'A', 'F', '1992-01-02', '1992-02-11', '1992-01-18', 'TAKE BACK RETURN', 'TRUCK', 'y against the furiously regular');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(2184032, 1394196, 44223, 5, 14.00, 18061.82, 0.06, 0.02, 'A', 'F', '1992-01-02', '1992-02-25', '1992-01-15', 'DELIVER IN PERSON', 'RAIL', 'even ideas breach slyly above the d');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(5018977, 820387, 20388, 1, 20.00, 26146.80, 0.00, 0.00, 'A', 'F', '1992-01-02', '1992-03-19', '1992-01-15', 'NONE', 'SHIP', 'packages detect furiously quick');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(8478693, 842913, 92930, 5, 13.00, 24126.31, 0.01, 0.03, 'A', 'F', '1992-01-02', '1992-02-02', '1992-01-05', 'DELIVER IN PERSON', 'REG AIR', 'y silent decoys');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(9838337, 201251, 26254, 1, 10.00, 11522.40, 0.03, 0.05, 'A', 'F', '1992-01-02', '1992-03-27', '1992-01-22', 'NONE', 'RAIL', 'pending pinto beans. boldly unusual de');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(11174723, 851066, 76075, 1, 41.00, 41697.82, 0.07, 0.02, 'A', 'F', '1992-01-02', '1992-03-28', '1992-01-08', 'NONE', 'MAIL', 's detect blithely entic');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(12493984, 912626, 87654, 4, 6.00, 9831.48, 0.02, 0.08, 'A', 'F', '1992-01-02', '1992-02-13', '1992-01-29', 'TAKE BACK RETURN', 'REG AIR', 'e the slyly e');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(12575687, 330833, 30834, 4, 41.00, 76416.62, 0.02, 0.04, 'A', 'F', '1992-01-02', '1992-03-10', '1992-01-28', 'DELIVER IN PERSON', 'RAIL', 'ecial frets. carefully sly depo');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(12753441, 1023833, 98864, 4, 35.00, 61487.30, 0.10, 0.08, 'A', 'F', '1992-01-02', '1992-02-18', '1992-01-23', 'COLLECT COD', 'FOB', 'encies haggle. regular, r');
INSERT INTO lineitem
(l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment)
VALUES(15413986, 1799270, 99271, 4, 14.00, 19168.66, 0.05, 0.05, 'A', 'F', '1992-01-02', '1992-01-31', '1992-01-04', 'COLLECT COD', 'TRUCK', 'structions. blithely pending asymptotes');
CREATE VIEW revenue0 AS
SELECT
l_suppkey AS supplier_no,
sum(l_extendedprice * (1 - l_discount)) AS total_revenue
FROM
lineitem
WHERE
l_shipdate >= '1992-01-01'
AND l_shipdate < DATE_ADD('1992-01-01',INTERVAL 3 MONTH)
GROUP BY
l_suppkey;
SELECT * from revenue0;
Environment
Are you interested in submitting a PR to solve the problem?
The text was updated successfully, but these errors were encountered: